1E  ImageMagick FAQB 2 2 2 × 1  S<8 u


    B
  1. I received theB following message, "?????? delegation failed ...". What does it mean? 

    E
  2. How can I improveA the appearance of 24-bit images displayed on my colormapped X server? 

    D
  3. How do I set theA transparency index in a GIF image so it displays properly within Mozilla? 

    B
  4. How can I stopE the filenames from changing in the title bar of the animate(1) image window? 

    E
  5. The image grabbedA by import(1) does not look like the image on my X server. What's wrong 

    D
  6. How do I animate# a digital YUV image sequence? 

    A
  7. How do I view+ only the red channel of an RGB image? 

    C
  8. How do I change. the default PostScript page size? 

    E
  9. When I display orC convert an image, I get Memory allocation error. What can I do? 

    =
  10. How do IC concatenate three images left-to-right with no borders, frames, or text? 

    D
  11. How do I create: a GIF animation sequence to display within Netscape? 

    E
  12. When I display aB PostScript image it appears to be trimmed. I would like to9 display the entire page, including any white space. 

    D
  13. What are visual+ image directories? How do I use them? 

    B
  14. I have an HP.; How do I take advantage of the Color Recovery option? 

    E
  15. I use the windowB ID reported by xwininfo(1) with import and it does includeE the window manager frame as expected. How can I save the window with its frame? 

    C
  16. I displayed anC image and it appears as one solid color. What did I do wrong? 

    C
  17. I received theB following message, "???? library is not available ...". What does it mean? 

    >
  18. I want toC inspect the values of the matte channel within my image. How can I do that? 

    C
  19. Convert in.gif@ out.png" says "Invalid Parameter - out.png" 

    B
  20. How can I addE one of those cool bevels to my image that I see used on the Web?

    D
  21. I try to launch= display from my window manager and it fails. What's up? 

    C
  22. When I convertB Postscript to another format, how can I improve the appearance of the text? 

    >
  23. How can I= annotate an image with text that is 2 to 3 inches tall? 

    >
  24. How can IB convert my GIF animation sequence to individual image files? 

    E
  25. How can I removeB the background that prints around my image when I display it with Netscape? 

    D
  26. How do I create. a GIF or PNG image with Web safe colors? 

    C
  27. How come Adobe6 Acrobat 2.1 can't read ImageMagick's PDF format? 

    D
  28. How can I add a matte layer to my image? 

    C
  29. How can I draw1 with text using 'convert' under Windows NT? 

    C
  30. Why are my GIF$ files larger than expected?

    D
  31. Why are my JPEG$ files larger than expected?

    
º






C
1. I receivedA the following message, "?????? delegation failed ...". What does it mean?

DImageMagick uses several freely available packages to performIthe translation of certain image formats (PostScript, MPEG,Aetc.). Make sure these packages are available as described in theAREADME file. Also verify that you haveBplenty of temporary disk space. If not, set the TMPDIR environment:variable to an area where space is available. Finally, forEPostScript, verify that Ghostscript supports the pnmraw>or ppmraw device (gs -h) and that the documentDcontains valid PostScript statements (gs image.ps). 


B
2. How can ID improve the appearance of 24-bit images displayed on my colormapped X server?


?If you have a colormapped X server, the number of uniqueEcolors in an image must first be reduced to match the requirements ofJyour server before it can be displayed. DisplayDtries to make the color reduced image closely resemble the original.AHowever, there are some options that may improve the appearance. 

D

You can use a private colormap. By default, your image must shareEcolors with existing applications on your X server. The colorsBin your image may be very different than the shared colors and the,results may be visually unsatisfactory. Try 

P
 display -colormap private image.miff

BThe disadvantage is the annoying colormap loading and unloading as6you move your pointer in and out of the image window. 

C

The YCbCr colorspace may give better results when color reducingimages of people faces. Try 

P
 display -colorspace YCbCr image.miff

?If you intend to view an image frequently, reduce the number ofEcolors to match the resolution of your X server once and write:to a new image. Then display this new image. For example, 

7
 convert -colors 256 -dither image.jpeg image.miff display image.miff

EThis forces the time-consuming process of color reducing the image to8one-time, rather than each time the image is displayed. 



E
3. How do I setE the transparency index in a GIF image so it displays properly within Mozilla?
3
?Display your GIF image with display.?Choose Matte from the Image Edit command menu andLidentify a pixel that has the transparency color. Press MethodDand select a matte edit method from a pop-up menu. Choose from these methods: 
 point replace floodfill

EThe point method changes the matte value of any pixel selectedDwith the pointer until the button is is released. The replaceEmethod changes the matte value of any pixel that matches the color ofBthe pixel you select with a button press. Floodfill changesDthe matte value of any pixel that matches the color of the pixel you.select with a button press and is a neighbor. 

E

Select your transparent pixel with the pointer and press a button.EThe image is redisplayed with any transparent pixels recolored to theBbackground color. You can select other pixels or areas to force to3transparent. When you are satisfied, press Return. 

C

Finally, choose Save from the command menu and write yourDGIF image to a file. Note that setting transparency works best onBa TrueColor or DirectColor visual. If your server only exportsCcolormapped visuals you will need to use a Standard Colormapto set transparency. 


 xstdcmap -best display -map list image.gif choose Matte Edit7 select your transparent pixel then press Return choose Save

7If you do not have the xstdcmap(1) program, try 

L
 display -visual TrueColor image.gif


B
4. How can ID stop the filenames from changing in the title bar of the animate(1) image window?
3
EAnimate updates the image file name in theAtitle bar of the image window as each image is displayed from theCimage sequence. To display just a single name that will not change,use -title: b
 animate -title "My Image Sequence" images.


B
5. The imageI grabbed by import(1) does not look like the image on my X server. What's wrong?
3
Use the -descend option: K
 import -descend image.miff

or set this X resource: 

@
 import.descend: True

DBy default, import quickly grabs the imageEfrom the X server. However, it may not always have the correct<colors in some areas. This can happen when a subwindow has aZdifferent colormap than its parent. With -descend, importEdescends the window hierarchy. Descending involves grabbing the imageCand colormap of each window or subwindow associated with the window<you select and compositing it on a blank canvas. This can be@significantly slower than just grabbing the top-level window butensures the correct image. 



A
6. How do I+ animate a digital YUV image sequence?
3
ESuppose your sequence is 72 352x240 frames titled frame0.Y, frame0.U,5frame0.V, frame1.Y, frame1.U, etc. Use this command: `
 animate -geometry 352x240 -scene 0-71 yuv3:frame%d


A
7. How do I0 view only the red channel of an RGB image?
3
+Use the -gamma option, for example, S
 display -gamma 1.0,0.0,0.0 image.miff


A
8. How do I5 change the default PostScript page size?
3
EThe default dimensions of a PostScript page is 612x792. If youCprefer another default, change the page geometries (PSPageGeometry)(in magick/image.h and recompile.
"
A 9. When I display or convert an image, I get4 Memory allocation error. What can I do?
3
=Memory allocation is a complex topic in ImageMagick and imageCprocessing requires a lot of memory. ImageMagick tries to take bestLadvantage of the resources available by optimizing its use of virtualCmemory. Virtual memory is normally the amount of RAM (Random AccessEMemory) available to the process plus the amount of free space in theIsystem paging area (known as "swap" under Unix, or a "page@file" under Windows). In addition to the RAM and the paging@area, ImageMagick is able to expand the amount of virtual memoryAavailable by using memory-mapped files which cause the file to be@treated as extra memory. A piece of hardware known as the Memory@Management Unit (MMU) performs the magic which allows the systemCpaging area and memory-mapped files to be treated as more memory byJyour system's CPU.
@Usually when a memory allocation error occurs, it is because the>system's paging area is full, or the programs memory (heap) isEfragmented badly enough that there is no large-enough block of memoryDavailable to satisfy the request. In some cases the operating systemsmay artificially limit the memory available to the program.
CFailures of small memory allocations are generally considered fatalDby ImageMagick. If it is impossible to allocate even a little bit of?memory, then there is no point in continuing. When large memoryDallocations associated with allocating memory for image pixels fail,AImageMagick uses that as a key to know that it should start usingDmemory-mapped temporary files to increase virtual memory. Under Unix@and other POSIX-compliant systems, these memory-mapped temporary=files are created in either the system default location (e.g.B/var/tmp) or the directory set by the TMPDIR environment variable.BUnder Windows, temporary files are created in the directory set by]the TEMP or TMP environment variable.
DIf the temporary file directory is too small, or is itself mapped toAthe system's paging area (no win!), then ImageMagick will fail toCallocate more virtual memory via the temporary file and will returnAan error.
;The single biggest factor in how much memory is required byAImageMagick is the QuantumDepth setting when it was compiled. The?amount of memory (in bytes) required to store a single image in,memory is may be calculated via the equationE(QuantumDepth*Rows*Columns*5)/8. As a means of example, the followingDtable shows the amount of memory consumed by a single 1024x768 image3using the supported QuantumDepth settings:


8       9   :   : 


QuantumDepth



Virtual Memory



8



3MB



16



8MB



32



15MB



@
Performing an@image processing operation may require that several images be inEmemory at one time. In the case of animations, hundreds of images may!be in memory at one time.

DImageMagick is designed to be general purpose. It can displayEmany image storage formats (Monochrome, PseudoColor, or=TrueColor) on many different types of X visualsE(StaticGray, StaticColor, PseudoColor, GrayScale, DirectColor,@or TrueColor). To support all these combinations of image8storage formats and X visuals, extra memory is required.WAdditionally, animate and montage-store an entire image sequence in memory.

D
It is recommendedEthat systems used to run ImageMagick have at least 96MB of RAMBand 140MB free in their paging area. Systems used to process largeEimages (do the math!) may require considerably more memory to operateCefficiently. RAM is typically 1000 times faster than disk, so it isDimportant to keep as much data in RAM as possible (buy lots of RAM).EThe temporary file area should have plenty of free space. The size ofDthe temporary file area is usually the deciding factor as to whetherBImageMagick is able to complete an operation. With sufficient free<disk space, ImageMagick is primarily limited by your CPU andBoperating system's ability to address memory. ImageMagick has beenAused to process images 20K by 20K pixels in size!


C
10. How do IC concatenate three images left-to-right with no borders, frames, or text?
3
MAssume your three images are called image1.ppm, image2.ppm,and image3.ppm. Type F
 montage -mode concatenate -tile 3x1 image1.ppm image2.ppm \& image3.ppm concatenated.miff

ATo concatenate the images top-to-bottom, use -tile 1x3. 

_

For more control over the placement of an image, use composite.CFirst create a matte image and position your images onto the matte. For example, 

3
 convert -size 350x500 xc:black composite.miffB composite -geometry +0+0 composite.miff image1.gif composite.miffP composite -geometry "+1"00+0 composite.miff image2.gif composite.miffD composite -geometry +0+300 composite.miff image3.gif composite.miffJ composite -geometry +0+375 composite.miff image4.gif composite.miff


C
11. How do IA create a GIF animation sequence to display within Netscape?
3
AUse convert with the -delay andE-page options. The -delay option is used to specify the@delay in 1/100ths of a second between the display of each%frame of the animation. For example, [
 convert -delay 20 frame*.gif animation.gif

@You can also declare specific delays for each frame of the image;sequence. For example, if the delay was 20, 10, and 5, use 

9
 convert -delay 20 frame1.gif -delay 10 frame2.gif \+ -delay 5 frame3.gif animation.gif

DUse -page to specify the left and top locationsof the image frame: 

X
 convert frame1.gif -page +50"+1"00 frame2.gif -page +0"+1"00 \" frame3.gif animation.gif

BFinally, if you want the image to loop within Netscape, use-loop: 

U
 convert -loop 50 frame*.gif animation.gif

iFor further information about GIF animation, see GIFAnimation on the WWW. 

E

Note, that all the images are composited into a single multi-imageBGIF animation. If you want a single image produced for each frame,use +adjoin: 

N
 convert +adjoin images.* frames%d.gif


A
12. When ID display a PostScript image it appears to be trimmed. I wouldA like to display the entire page, including any white space.
3
EImageMagick automatically trims any PostScript image asAdefined by the bounding box. To preempt this behavior, remove theDbounding box statement from the Postscrpt or explicitly set the pagesize. For example, K
 display -page letter image.ps


C
13. What are2 visual image directories? How do I use them?
3
CA visual image directory (VID) is an image that contains thumbnailsAof one or more images in a file directory. Rather than displaying@each individual image at its full resolution, you can browse theEvisual image directory and choose an image to display. You can create%a VID with either of these commands: &
 montage *.jpg directory.vid+ convert 'vid:*.jpg' directory.vid

YOf course you can substitute any filenames you desire. MontageEhas many relevant command line options. You can exercise more controlLover the appearance of the VID than with convert.



Next display the directory: 

A
 display directory.vid

BFinally browse and select an image to display. Move the pointer tothe image and press button 3. 

7

You can create the VID directory with this command: 

?
 display 'vid:*.jpg'

DYou can also select Visual Image... from the File menuof the command widget. 

D

Note, that creating a VID is time consuming. Creating them@on-the-fly within display may be less^convenient than using montage or convertC. Also, if you create them with montage.Eor convert, you can reuse them as often as necessary. 

>

Note that a visual image directory is useful for looking at(individual frames of an image sequence: 

>
 display vid:movie.mpg


D
14. I have an? HP. How do I take advantage of the Color Recovery option?
3
Type M
 display -map list image.miff

œIf you want to use Color=Recovery all the time, put this in your X defaults file: 

=
 display.map: list

=Now if you need to turn off Color Recovery temporarily, type 

C
 display +dither image.miff


D
15. I use theA window ID reported by xwininfo(1) with import and it doesA include the window manager frame as expected. How can I save the window with its frame?
3
EBy default, xwininfo(1) returns the ID of the window you clickBon. Use the -frame option to get the reparented window ID: @
 xwininfo -frame

NYou can then use the returned window ID with import:

M
 import -frame -window ID window.miff


<
16. ID displayed an image and it appears as one solid color. What did I do wrong?
3
DA blank image generally means that the image is either corrupt or itIhas a matte channel and the matte values are all zero. ImageMagickDtreats a matte value of zero as completely transparent. To determineif this is the problem, try G
 display +matte image.miff


E
17. I receivedF the following message, "???? library is not available ...". What does it mean?
3
BImageMagick requires source libraries not included with theEdistribution to view or convert certain image formats such as JPEG or>TIFF. The above message means you did not compile the required]library and link with the ImageMagick utilities. See READMEOfor the location of these libraries and compiling instructions.


D
18. I want toC inspect the values of the matte channel within my image. How can I do that?
3
CView the matte image as a gray scale image. Suppose you have a TIFFDimage that has a matte channel and is 640 pixels in width and 480 inheight. Type: )
 convert image.tiff image.matte- display -size 640x480 gray:image.matte


H
19. "ConvertF in.gif out.png" says "Invalid Parameter - out.png"

?You have inadvertently run the Microsoft Windows program calledBconvert.exe, rather than the ImageMagick program of the same name.EThe Windows convert.exe program is used to convert a system boot diskAfrom MS-DOS "FAT" format to NTFS format. As such it canfonly be used one time in the life of a system.
You can 


D
20. How can II add one of those cool bevels to my image that I see used on the Web?
3
DThere are four types of ornamental borders you can add to your imageEwith ImageMagick. Each is listed below with the procedure to use themwith your image. 


C
21. I try toD launch display from my window manager and it fails. What's up?
3
@Display determines if it is executingAinteractively and behaves differently depending on the result. ToAconvince display you are running in anAinteractive environment when launching from a window manager, use either of
 display logo:Untitled  display < /dev/console


A
22. When I< convert Postscript to another format, how can I improve the appearance of the text?
3
CSimple. Increase the dots-per-inch when converting and sub-sample: f
 convert -density 288 -geometry 25% image.ps image.gif

BChange the density to 144 and geometry to 50% if the above commandDfails due to insufficient memory. Alternatively, see the Ghostscript.documentation about using high-quality fonts. 

B

The -density option increases the number of pixels (orCdots) generated by Ghostscript when processing the input postscriptDfile. However as all other images formats are generally displayed onEscreens which are typically about 72 to 100 dots per inch, the outputimage will be larger. 

@

The -geometry option reduces the large image output ofDghostscript image back to a normal 72 dpi resolution (25% of 288 dpiDgives 72 dpi) but in the process anti-aliases (or smooths) the fontsCand lines of the image so as to remove the jaggies you would<otherwise get from a normal postscript to image conversion. 



D
23. How can I= annotate an image with text that is 2 to 3 inches tall?
3
BIf you do not access to a particular named font that is large, try?scalable fonts. First see if you have any scalable fonts. Type {
 xlsfonts -fn '*-0-0-0-0-*'
DOr if you are using display, use the fontDpattern above within the Font Browser (see Image Edit->Annotate).?Next substitute the appropriate resolution. Keep in mind that aEscalable font must be fully qualified to work. That is, all 14 fieldsAmust be specified. Here is one example where we annotate an image"with large Helvetica text: J
 convert -font '-*-helvetica-*-*-*--300-300-*-*-*-*-iso8859-1' \H -fill green -draw 'text 50,300 Magick' image.gif annotated.gif

=If you have the FreeType support built into ImageMagick, just(increase your pointsize and/or density: 

`
 convert -font Helvetica -pointsize 100 -density 300 ...


D
24. How can IB convert my GIF animation sequence to individual image files?

KUse the scene embedded file format with convert:"
@    convert animation.gif frame%02d.gif 8
:The resulting image files are titled frame01.gif,1frame02.gif, frame03.gif, etc. 


D
25. How can ID remove the background that prints around my image when I display it with Netscape?

GUse the +page option of the convert command: "
=    convert +page alpha.gif beta.gif 8
BGIF allows for a page offset relative to some background. The page@offset information may have been in your GIF image already or itEcould have been introduced by ImageMagick. Either way, +page>removes the unwanted page offset and Netscape should behave as expected. 


C
26. How do I5 create a GIF or PNG image with Web safe colors?

FUse the -map option of the convert command: "
E    convert -map netscape: alpha.gif beta.gif"
@Netscape predefines 216 colors for colormapped displays. Use the>above command to ensure only these predefined colors are used.COtherwise Netscape dithers your image with varying degrees of image fidelity. 


C
27. How come< Adobe Acrobat 2.1 can't read ImageMagick's PDF format?

CThe default PDF compression is Zip. You need Acrobat 3.0 andCabove to read Zip compressed PDF. Instead use no compression or LZW*compression when you create the PDF file: "
D    convert +compress images.tiff image.pdf 


D
28. How can I$ add a matte layer to my image?

:One way is to use a bitmap as your transparency mask. Try "
A      composite -compose CopyOpacity(image.gif mask.xbm transparent.gif 8
?Note, GIF is limited to one transparent color. If your mask hasDvariable opacity, use a format like MIFF, TIFF, or PNG as you outputimage format. 


D
29. How can I6 draw with text using 'convert' under Windows NT?

CThe problem is that NT interprets the command line differently than@Unix does, causing the documented command to fail. The following?command has been reported to work correctly (all on one line): "
A      convert -font Arial -fill blue9-draw "text 10,10 'your text here'" d:\test.tifpng:d:\test.png "
Cand here is another example which is reported to work (which relies-on Ghostscript's 'gs' program to installed): "
B      convert.exe -pointsize 18 -draw>"text 0,0 "This is my text!"" C:\blank.gifc:\text.gif 


E
30. Why are my% GIF files larger than expected?

CLZW compression is disabled by default for GIF (also TIFF) formats,Abecause of the UniSys patent. You can rebuild ImageMagick with itBenabled, after you have obtained a license from UniSys. Or you can;use a third-party commercial UniSys-licensed application torecompress them. "




E
31. Why are my/ JPEG files larger than expected?
2
AYour JPEG files may contain embedded "profiles" such asBExif or IPTC, or they may contain uncompressed thumbnails. You can=use the +profile "*"?commandline option or an equivalent API method to remove them.

>

9Image manipulation software that works like magic.