=J D H C ImageMagick - Image Processing and Display Package; C
D Install

 
F
"I swear by my life and my love of it that I will neverKlive for the sake of another man, nor ask another man to live for mine"M

John Galt in Atlas Shrugged, by Ayn Rand


 

>Contents






>Author




The author isImagick@wizards.dupont.com.HThis software is NOT shareware. However, I am interested in who might beIusing it. Please consider sending me a picture postcard of the area where you live. Send postcards to
/
      John Cristy*      P.O. Box 409      Landenberg, PA  19350(      USA

FI'm also interested in receiving coins or stamps from around the worldfor my collection.

/Back to Contents  


>Availability




ImageMagick, version 4.2.9, is available on ftp.wizards.dupont.com.ImageMagick clientOexecutables!are available for some platforms.IMacintosh,ANT,CVMS,andMLinux source%and binaries are also available.
G

I want ImageMagick to be of high quality, so if you encounterHa problem I will investigate. However, be sure you are using the mostrecent version fromSftp.wizards.dupont.com,Gor a mirror site, before submitting any bug reports or suggestions.Report any problems via the ;!web-based reporting facility.

/Back to Contents
 



>WWW




.The official ImageMagick WWW page is at`www.wizards.dupont.com.




GTo use display as your external imageIviewer, edit the global mailcap file or your personal mailcap fileI.mailcap (located in your home directory) and put this entry:
=
      image/*; display %s


2

Back to Contents
 


>Mailing"List




=There is a mailing list for discussions and bug reports aboutImageMagick."To subscribe send the message
:
      subscribe magick
toOmajordomo@wizards.dupont.com.GYou will receive a welcome message which tells you how to post messages to the listNmagick@wizards.dupont.com.
/Back to Contents
 



>Memory*Requirements




GYou should allocate sufficient swap space on your system before runningGImageMagick; otherwise, you may experience random server or applicationIcrashes. Anything less than 80 megabytes of swap space is likely to causerandom crashes.




HOn many systems, you will find that 80 megabytes is insufficient and youGwill have to allocate more swap space. You should also have at least 32Kmegabytes of real memory although 64 megabytes or more is recommended.

/Back to Contents
 

>UNIX)Compilation




Type:
Q
      gzip -dc ImageMagick-4.2.9.tar.gz | tar xvf -9      cd ImageMagick-4.2.9

If you do not have gunzip, it is available on prep.ai.mit.edu.
G


There are currently two mechanisms available to create makefilesto build ImageMagick:




LTo confirm your build of the ImageMagick distribution was successful, type:
1
      display

FIf the program faults make sure that you may have inadvertingly linkedDto an older version of the libMagick library. In this case type
9
      cd ImageMagick/magick+      make install$      cd ..)      make
4If the image colors are not correct use this commandA
      display -visual default

FYou can find other example images in the images directory.
P

For additional information, see the manual pages for these ImageMagick utilities





GAlso read the ImageMagick Frequently AskedIQuestions This is a required reading. Most of the questions I get via3electronic mail are answered in this document.




IPlace display X application defaults in)/usr/lib/X11/app-defaults/Display.HUse the appropriate name for other clients (e.g. Animate, Montage, etc).HTo execute display from as a menu item5of any window manager (olwm, mwm, twm, etc), use
3
    display logo:Untitled

/Back to Contents
 

>Delegates




GTo further enhance the capabilities of ImageMagick, you may want(to get these programs or libraries:




P
>Background Texture

KImageMagick requires a background texture for the TILE formatIand for the -texture option of montage.BYou can use your own or get samples or get additional samples from4KPT.





P
>BZLIB

IImageMagick requires the BZLIB library to read or write Zipcompressed MIFF images.





P
>RALCGM

RImageMagick requires ralcgm to read Computer Graphic MetafileQimages (may not compile under linux). You also need Ghostscript (see below).





P
>TransFig

OImageMagick requires fig2dev to read TransFig images.





P
>GET

FImageMagick requires GET to read images specified with aLWorld Wide Web (WWW) uniform resource locator (URL). Note: do not confuseHthis get program with SCCS get program. If you do not have a HTTPWserver, you can use xtp, available in the ImageMagick)distribution, for URL's whose protocol isFTP.





P
>FPX

IImageMagick requires the FlashPix SDK to read and write theFPX image format.





P
>FreeType

HImageMagick requires the FreeType software, version 1.1 or above,%to annotate with TrueType fonts.





P
>HDF

IImageMagick requires the NCSA HDF library to read and write!the HDF image format.





P
>HTML2PS

FImageMagick requires html2ps to read HyperText Markup#Language (html) documents.





P
>JBIG

JImageMagick requires the JBIG-Kit software to read and write"the JBIG image format.





P
>JPEG

HImageMagick requires the Independent JPEG Group's software-to read and write the JPEG image format.

Apply the]losslessIJPEG patch to Independent JPEG Group's source distribution to read(lossless jpeg-encoded DICOM images:
E

Concerning iterative JPEG compression: see Kinoshita and Yamamuro,LJournal of Imaging Science and Technology, Image Quality with ReiterativeGJPEG Compression, Volume 39, Number 4, July 1995, 306-312 who claimOthat (1) the iterative factor of the repetitive JPEG operation had no influenceSon image quality, and (2) the first compression determined base image quality.





P
>MPEG

GImageMagick requires the MPEG encoder / decoder to read or write"the MPEG image format.





P
>PNG

IImageMagick requires the PNG library, version 1.0 or above,)to read the PNG image format.





P
>Postscript

TImageMagick requires GhostscriptGsoftware to read the PostScript or the Portable Document format.FIt is used to annotate an image when an X server is not available. SeeHthe FreeType library above for another means to annotate an image. Note,QGhostscript must support the ppmraw device (type gs -h to verify). If GhostscriptGis unavailable, the Display Postscript extension is used to rasterize aFPostscript document (assuming you define HasDPS). The DPS extension isGless robust than Ghostscript in that it will only rasterize one page ofa multi-page document.





P
>RA_PPM

JImageMagick requires ra_ppm from Greg Ward's RadianceNsoftware to read the Radiance image format (may not compile under linux).





P
>RAWTORLE

OImageMagick requires rawtorle from the Utah Raster ToolkitBto write the RLE image format (may not compile under linux)..





P
>SANE

LImageMagick requires scanimage to import images from a scanner device.





P
>TIFF

HImageMagick requires Sam Leffler's TIFF software toKread and write the TIFF image format. It in turn optionally requires!the JPEG and ZLIB libraries.





P
>WMF

LImageMagick requires wmftopng to read Windows Meta File images.





P
>X Server

GImageMagick requires an X server for display and animate to workIproperly. This free X server is available for Windows and Macintosh.





P
>ZLIB

OImageMagick requires the ZLIB library to read or write PNG$or ZLIB compressed MIFF images.



2

Back to Contents
 


>How(to Compile




DThe following procedure describes how to build ImageMagick extensionHlibraries in subdirectories of the ImageMagick directory. An alternativeJto these procedures is to install one or more of these under your system'sPregular include/lib directory (e.g. the directory specified by --prefixLto configure or /usr/local). This allows the libraries to be sharedGby other packages. When using the configure script, the two schemes maySbe mixed. Also, please note that when the configure option --enable-sharedPis not disabled, these procedures must be supplemented with whatever compilationFflags are required on your system to generate PIC code. In the case ofIgcc, this usually means that -fPIC must be added to the compiler?options (i.e. CFLAGS) when building each delegate library.

>To display images in the HDF, JPEG, PNG, TIFF or TTFQformat, get the respective archives and build ImageMagick as follows:





HDF
2
      cd ImageMagickD      gunzip -c HDF4.1r3.tar.gz | tar xvf -.      mv HDF4.1r3 hdf%      cd hdf(      configure7      make -k hdf-libnofortran*      cd ..



JBIG
2
      cd ImageMagickH      gunzip -c jbigkit-1.1.tar.gz | tar xvof -/      mv jbig-kit jbig&      cd jbig#      make*      cd ..



JPEG
2
      cd ImageMagickH      gunzip -c jpegsrc.v6b.tar.gz | tar xvof -.      mv jpeg-6b jpeg&      cd jpeg(      configure#      make*      cd ..



PNG
2
      cd ImageMagickH      gunzip -c libpng-1.0.3.tar.gz | tar xvf -2      mv libpng-1.0.3 png%      cd png#      make*      cd ..



TIFF
2
      cd ImageMagickH      gunzip -c tiff-v3.5.2.tar.gz | tar xvof -2      mv tiff-v3.5.2 tiff&      cd tiff*      ./configure#      make*      cd ..



TTF
2
      cd ImageMagickI      gunzip -c freetype-1.3.tar.gz | tar xvof -2      mv freetype-1.3 ttf%      cd ttf:      ./configure -disable-shared#      make*      cd ..



ZLIB
2
      cd ImageMagickF      gunzip -c zlib-1.1.3.tar.gz | tar xvf -8      mv zlib-1.1.3.tar.gz zlib&      cd zlib#      make*      cd ..


DIf your computer system supports shared libraries you must type
6
      make install

$Finally, perform the following:
2
      cd ImageMagickS      edit Magick.tmpl and define Has???? as instructed(      xmkmf-      make Makefiles)      make clean)      make

;If prefer to use configure rather than Imake:
-
      configure)      make clean,      make -k

IIf the compile fails due to a function redefinition it may be that either=jpeg/jconfig.h or mpeg/mpeg.h is redefiningconst.$Fix this problem and try again.




HYou can now convert or display images in the JPEG, TIFF, PNG, etc. image formats.

JIf you have HDF, JBIG, JPEG, PNG, and TIFF sources installed)as directed above, you can also type
5
      Install sun

JSubstitute the appropriate machine type (aix, hpux, sgi, etc).


2

Back to Contents
 


>VMS)Compilation




HYou might want to check the values of certain program definitions beforeHcompiling. Verify the definitions in delegates.mgk to suit your$local requirements. Next, type:




?
      unzip ImageMagick-4.2.9.zip9      set default [.imagemagick]$      @makeH      set display/create/node=node_name::

>where node_name is the DECNET X server to contact.
Finally type:
1
      display

FAlternatively, get a zipped distribution (with JPEG, PNG, TIFF,andmTTF) from ftp.wizards.dupont.com.

MThe VMS JPEG, PNG, TIFF, and TTF source libraries are availableBon axp.psl.ku.dk in [anonymous.decwindows.lib].

XThanks to pmoreau@cenaath.cena.dgac.frIfor supplying invaluable help as well as the VMS versions of the JPEG,-PNG, TIFF, and TTF libraries.


2

Back to Contents
 


>Windows NT/95 Visual C++ 6.0 Compilation




0The Visual C++ distribution targeted at Windows DThe NTJis provided in the VisualMagick subdirectory of the distribution.?There are two workspaces (DSW files) that can be used to do thecomplete build:
@    VisualMagick.dsw : The one used to build everything as DLL's?    VisualMagickStatic.dsw: The one used to build everything as8                            static standalone executable
:
A complete build can be accomplished by simply doing:
    Build: Batch Build: Clean    Build: Batch Build: Build
K
The Clean step is needed in order to make sure that all of the?target support libraries are updated with any patches needed to(get them to compile properly on Windows.G
All of the required files that are needed to run any of the commandFline tools will be found in the "bin" subdirectory of the VisualMagickBsubdirectory. This includes EXE, and DLL files. You should be able@to test the build directly from this directory without having toBmove anything to any of the global SYSTEM or SYSTEM32 areas in theoperating system installation.B
NOTE: The two utilities display and3animate will compile andClink but not function in the default build environment. This is dueAto the fact that the default build environment uses the X11 stubsBto supply non-functional stubs for X-Window functionality. This is@due to the lack of a high need for this on a Windows NT or Win95Bonly system. Work is underway to add X11 libraries to the standard distribution in the neat future.
2To view any image in a Microsoft window, type
4
    convert image.ext win:

HImport works if you have at least one X windowopen. Alternatively, type
6
    convert x:root image.png

GMake sure gswin32 (Ghostscript) is in your execution path (seeAutoexec.bat),Lotherwise, you will be unable to convert or view a Postscript document.




IMake sure iexplore (Internet Explorer) is in your execution pathH(see Autoexec.bat), otherwise, you will be unable to browse the&ImageMagick documentation.




6The NT executables will work under Windows 95/98.

2

Back to Contents
 




>Macintosh)Compilation




VThe Macintosh MacintoshFdistribution contains MetroWerks Codewarrior Professional projects forJcompilation. For those who do not have access to CodeWarrior, the binariesHfor the command line utilities are enclosed. I had to comment the inlineintrinsic functions in0math.h in order to compile. If you haveJa better solution, let me know. Display,*animate,andDimport currently do not work on theMacintosh.




"I'm looking for a volunteer to get)DisplayandCanimate to work on the Macintosh.GI also need a volunteer is needed to write a simple Mac program to callthe@libMagick routines and display an image in a window.

2

Back to Contents
 


>Animation




LTo prevent color flashing on visuals that have colormaps, animate(1) createsMa single colormap from the image sequence. This can be rather time consuming.JYou can speed this operation up by reducing the colors in the image beforeyouanimate them. Use+mogrify to colorreduce the images:
T
      mogrify +map -colors 256 scenes/dna.[0-9]*
JAlternatively, you can use a Standard Colormap; or a static,Hdirect, or true color visual. You can define a StandardPColormap with xstdcmap(1). For example, to use the "best" StandardColormap, type:2
      xstdcmap -bestH      animate -map best scenes/dna.[0-9]*

#or to use a true color visual:
U
      animate -visual truecolor scenes/dna.[0-9]*

HImage filenames can appear in any order on the command line if the sceneKkeyword is specified in the MIFF image. Otherwise the images displayGin the order they appear on the command line. A scene is specified whenHconverting from another image format to MIFF by using the "scene"Ioption with any filter. Be sure to choose a scene number other than zero.KFor example, to convert a TIFF image to a MIFF image as scene#2, type:
P
      convert -scene 2 image.tiff image.miff


2

Back to Contents
 


>16-BIT%Imaging




GBy default, ImageMagick uses a color depth of 8 bits (e.g. [0..255] forHeach of red, green, blue, and transparency components). Any 16-bit imageFis scaled immediately to 8-bits before any image viewing or processingKoccurs. If you want to work directly with 16-bit images (e.g. [0..100535]),edit;Magick.tmpl and define QuantumLeap or use-enable-16bit with configure. Next, type:
"
    make clean    make
GIn 16-bit mode expect to use about 33% more memory on the average. AlsoJexpect some processing to be slower than in 8-bit mode (e.g. Oil Painting,Segment, etc).H

In general, 16-bit mode is only useful if you have 16-bit images thatFyou want to manipulate and save the transformed image back to a 16-bit1image format (e.g. PNG, VIFF).


2

Back to Contents
 


>64-BIT&Machines




<Each pixel, within ImageMagick, is represented by thePixelPacketHstructure found in magick/image.h. Only 8 bits are required forFeach color component and 16 bits for the colormap index for a total ofG6 bytes. If QuantumLeap is defined (see 16-BIT IMAGING above),Fthe color component size increases to 16 bits for a total of 10 bytes.JSome 64-bit machines pad the structure which can cause a significant waste#of memory. For the cray, change thePixelPacket structure to this
3
    typedef struct _PixelPacket    {,      unsigned char>        red : QuantumDepth,@        green : QuantumDepth,?        blue : QuantumDepth,B        opacity : QuantumDepth;-      unsigned short6        index : 16;'    } PixelPacket;
before compiling.G

I'm not sure if this will work on other 64-bit machines that pad. IfKyou know a better solution, please send me E-mail. Note, that the Dec AlphaFapparently does not pad the structure so ImageMagick should be fine onthis particular 64-bit machine.


2

Back to Contents
 


>MIFF*Image Format




IMIFF is an image format which I developed. I likeit because




    
  1. GIt is machine independent. It can be read on virtually any computer. No byte swapping is necessary.
  2. 
  3. KIt has a text header. Most image formats are coded in binary and you cannotHeasily tell attributes about the image. Use more(1) on MIFF image9files and the attributes are displayed in text form.
  4. 
  5. GIt can handle runlength-encoded images. Although most scanned images doGnot benefit from runlength-encoding, most computer-generated images do.KImages of mostly uniform colors have a high compression ratio and therefore(take up less memory and disk space.
  6. 
  7. GIt allows a scene number to be specified. This allows you to specify anFanimation sequence out-of-order on the command line. The correct order5is determined by the scene number of each image.
  8. 
  9. GMIFF computes a digital signature for images. This is useful forFcomparing images. If two image files have the same signature, they areidentical images.
  10. 
  11. FThere is a montage keyword allowing an image to act as a visual6image directory. See display(1) for more details.
  12. 




9One way to get an image into MIFF format is to use"convertFor read it from an X window using the importGprogram. Alternatively, type the necessary header information in a fileKwith a text editor. Next, dump the binary bytes into another file. Finally, type
_
      cat header binary_image | display -write image.miff -

GFor example, suppose you have a raw red, green, blue image file on disk>that is 640 by 480. The header file would look like this:
O
      id=ImageMagick columns=640 rows=480 :

GThe image file would have red, green, blue tuples (rgbrgbrgb...). Referto theEdisplay manual page for more details.


2

Back to Contents
 


>Copyright




1Copyright (C) 2000 ImageMagick Studio




HPermission is hereby granted, free of charge, to any person obtainingKa copy of this software and associated documentation files ("ImageMagick"),Hto deal in ImageMagick without restriction, including without limitationHthe rights to use, copy, modify, merge, publish, distribute, sublicense,Pand/or sell copies of ImageMagick, and to permit persons to whom the ImageMagickDis furnished to do so, subject to the following conditions:




JThe above copyright notice and this permission notice shall be included>in all copies or substantial portions of ImageMagick.




JThe software is provided "as is", without warranty of any kind, expressKor implied, including but not limited to the warranties of merchantability,Ffitness for a particular purpose and noninfringement.In no event shall6ImageMagick Studio be liable for any claim, damages orMother liability, whether in an action of contract, tort or otherwise, arisingKfrom, out of or in connection with ImageMagick or the use or other dealingsin ImageMagick.




GExcept as contained in this notice, the name of the E. I. du Pont deLNemours and Company shall not be used in advertising or otherwise to promoteRthe sale, use or other dealings in ImageMagick without prior written authorization%from the ImageMagick Studio.



Home Page Image3manipulation software that works like magic.