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

    
  1. II received the following message, "?????? delegation failed!...". What does it mean?
  2. 
  3. IHow can I improve the appearance of 24-bit images displayed+on my colormapped X server?
  4. 
  5. FHow do I set the transparency index in a GIF image so it)displays properly within Mosaic?
  6. 
  7. IHow can I stop the filenames from changing in the title bar(of the animate(1) image window?
  8. 
  9. IThe image grabbed by import(1) does not look like the image,on my X server. What's wrong
  10. 
  11. EHow do I animate a digital YUV image sequence?
  12. 
  13. JHow do I view only the red channel of an RGB image?
  14. 
  15. OHow do I change the default PostScript page size?
  16. 
  17. 7When I display or convert an image, I getMemory allocation"error. What can I do?
  18. 
  19. FHow do I concatenate three images left-to-right with no"borders, frames, or text?
  20. 
  21. IHow do I create a GIF animation sequence to display withinNetscape?
  22. 
  23. HWhen I display a PostScript image it appears to beUtrimmed. I would like to display the entire page, including any white space.
  24. 
  25. MWhat are visual image directories? How do I use them?
  26. 
  27. JI have an HP. How do I take advantage of the Color Recoveryoption?
  28. 
  29. .I use the window ID reported byxwininfo(1) withHimport and it does include the window manager frame as expected. How can*I save the window with its frame?
  30. 
  31. FI displayed an image and it appears as one solid color.What did I do wrong?
  32. 
  33. OI received the following message, "???? library is not available!...". What does it mean?
  34. 
  35. GI want to inspect the values of the matte channel within%my image. How can I do that?
  36. 
  37. FHow can I add one of those cool bevels to my image thatI see used on the Web?
  38. 
  39. KI try to launch display from my window manager and it fails.What's up?
  40. 
  41. MWhen I convert Postscript to another format, how can I improve$the appearance of the text?
  42. 
  43. JHow can I annotate an image with text that is 2 to 3 inchestall?
  44. 
  45. HHow can I convert my GIF animation sequence to individualimage files?
  46. 
  47. JHow can I remove the background that prints around my image)when I display it with Netscape?
  48. 
  49. IHow do I create a GIF image with Web safe colors?
  50. 
  51. FHow come Adobe Acrobat 2.1 can't read ImageMagick's PDFformat?
  52. 
  53. @How can I add a matte layer to my image?
  54. 





K1. I received the following message, "?????? delegation+failed ...". What does it mean?



HImageMagick uses several freely available packages to perform theLtranslation of certain image formats (PostScript, MPEG, etc.).:Make sure these packages are available as described in the!READMEGfile. Also verify that you have plenty of temporary disk space. If not,Hset the TMPDIR environment variable to an area where space is available.RFinally, for PostScript, verify that Ghostscript supports the pnmrawGor ppmraw device (gs -h) and that the document contains?valid PostScript statements (gs image.ps).




H2. How can I improve the appearance of 24-bit images8displayed on my colormapped X server?



FIf you have a colormapped X server, the number of unique colorsJin an image must first be reduced to match the requirements of your serverGbefore it can be displayed. Display tries toJmake the color reduced image closely resemble the original. However, there6are some options that may improve the appearance.
H


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

    display -colormap private image.miff
FThe disadvantage is the annoying colormap loading and unloading as you1move your pointer in and out of the image window.J

The YCbCr colorspace may give better results when color reducing imagesof people faces. TryB

    display -colorspace YCbCr image.miff
FIf you intend to view an image frequently, reduce the number of colorsGto match the resolution of your X server once and write to a new0image. Then display this new image. For example,I
    convert -colors 256 -dither image.jpeg image.miff+    display image.miff
OThis forces the time-consuming process of color reducing the image to one-time,-rather than each time the image is displayed.




I3. How do I set the transparency index in a GIF image2so it displays properly within Mosaic?



FDisplay your GIF image with display. Choose MatteIfrom the Image Edit command menu and identify a pixel that has theFtransparency color. Press Method and select a matte edit:method from a pop-up menu. Choose from these methods:

    point    replace"    floodfill
JThe point method changes the matte value of any pixel selected withFthe pointer until the button is is released. The replace methodHchanges the matte value of any pixel that matches the color of the pixelHyou select with a button press. Floodfill changes the matte valueIof any pixel that matches the color of the pixel you select with a buttonpress and is a neighbor.I

Select your transparent pixel with the pointer and press a button. TheLimage is redisplayed with any transparent pixels recolored to the backgroundIcolor. You can select other pixels or areas to force to transparent. When you are satisfied, press Return.G

Finally, choose Save from the command menu and write your GIFLimage to a file. Note that setting transparency works best on a TrueColorJor DirectColor visual. If your server only exports colormapped visualsDyou will need to use a Standard Colormap to set transparency.&

    xstdcmap -best.    display -map list image.png?      choose Matte Edit  Z      select your transparent pixel then press Return  4      choose Save
6If you do not have the xstdcmap(1) program, tryA
    display -visual TrueColor image.png




H4. How can I stop the filenames from changing in the5title bar of the animate(1) image window?



KAnimate updates the image file name in the titleKbar of the image window as each image is displayed from the image sequence.KTo display just a single name that will not change, use -title:
H
    animate -title "My Image Sequence" images.




H5. The image grabbed by import(1) does not look like:the image on my X server. What's wrong?



$Use the -descend option:
8
    import -descend image.miff
or set this X resource:8
    import.descend:  True
IBy default, import quickly grabs the image fromGthe X server. However, it may not always have the correct colorsHin some areas. This can happen when a subwindow has a different colormap&than its parent. With -descend, importIdescends the window hierarchy. Descending involves grabbing the image andJcolormap of each window or subwindow associated with the window you selectFand compositing it on a blank canvas. This can be significantly slowerFthan just grabbing the top-level window but ensures the correct image.




Q6. How do I animate a digital YUV image sequence?



OSuppose your sequence is 72 352x240 frames titled frame0.Y, frame0.U, frame0.V,/frame1.Y, frame1.U, etc. Use this command:
P
    animate -geometry 352x240 -scene 0-71 yuv3:frame%d




V7. How do I view only the red channel of an RGB image?



/Use the -gamma option, for example,
C
    display -gamma 1.0,0.0,0.0 image.miff




I8. How do I change the default PostScript pagesize?



LThe default dimensions of a PostScript page is 612x792. If you preferHanother default, change the page geometries in magick/image.h andrecompile.




@9. When I display or convert an image, I get Memory0allocation error. What can I do?



JThe simplest thing to do is to increase your real memory or virtual memoryMby expanding your swap partition. For ImageMagick to work effectively,Hyou should have at least 24mb of real memory and 48mb of virtual on yourFcomputer. And keep in mind processor speed as well. An image operationOthat takes 5 seconds on my 200mhz Sun Ultra may take 2 minutes on a 486pc.
G

ImageMagick is designed to be general purpose. It can displayEmany image storage formats (Monochrome, PseudoColor, orTrueColor)Hon many different types of X visuals (StaticGray, StaticColor,IPseudoColor, GrayScale, DirectColor, or TrueColor). To supportKall these combinations of image storage formats and X visuals, extra memoryJis required. In fact, each image requires up to 6 bytes per pixel to storebin memory. Additionally, animate and montageHstore an entire image sequence in memory. ImageMagick does reduceNmemory requirements by compressing pixel information with run-length encoding.IHowever, this is only effective for images with large runs of like pixelsKsuch as Postscript or computer generated images. As an example, a 1728x2500Ifax image may require only 0.5mb of memory. In contrast a JPEG image this"size could require 20mb of memory.G

For animation, consider using the MPEG programs from Berkeley if youHencounter memory limitations with animate. ItPonly stores a few frames at a time in memory. ConvertGhas an option to create the proper CCIR 601 2:1:1 files as input to theIMPEG program. However, the CCIR 601 2:1:1 image format is lossy. Computer(generated images may not look very good.





H10. How do I concatenate three images left-to-right-with no borders, frames, or text?



8Assume your three images are called image1.ppm,image2.ppm,"and image3.ppm. Type
S
    montage -mode concatenate -tile 3x1 image1.ppm image2.ppm \A      image3.ppm concatenated.miff
@To concatenate the images top-to-bottom, use -tile 1x3.7

For more control over the placement of an image, use#combine.GFirst create a matte image and position your images onto the matte. Forexample,E

    convert -size 350x500 xc:black composite.miff^    combine -geometry +0+0   composite.miff image1.png composite.miffV    combine -geometry "+1"00+0 composite.miff image2.png composite.miffT    combine -geometry +0+300 composite.miff image3.png composite.miffZ    combine -geometry +0+375 composite.miff image4.png composite.miff




L11. How do I create a GIF animation sequence to displaywithin Netscape?



AUse convert with the -delay and -pageMoptions. The -delay option is used to specify the delay in 1/100thsGof a second between the display of each frame of the animation. For example,
H
    convert -delay 20 frame*.png animation.png
JYou can also declare specific delays for each frame of the image sequence.0For example, if the delay was 20, 10, and 5, useK
    convert -delay 20 frame1.png -delay 10 frame2.png \R        -delay 5 frame3.png animation.png
GUse -page to specify the left and top locations ofthe image frame:V
    convert frame1.png -page +50"+1"00 frame2.png -page +0"+1"00 \I        frame3.png animation.png
BFinally, if you want the image to loop within Netscape, use -loop:G
    convert -loop 50 frame*.png animation.png
0For further information about GIF animation, see8GIFAnimation on the WWW.G

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

    convert +adjoin images.* frames%d.png




L12. When I display a PostScript image it appearsKto be trimmed. I would like to display the entire page, including any whitespace.



MImageMagick automatically trims any PostScript image as definedFby the bounding box. To preempt this behavior, remove the bounding boxOstatement from the Postscrpt or explicitly set the page size. For example,
;
    display -page letter image.ps




H13. What are visual image directories? How do I usethem?



FA visual image directory (VID) is an image that contains thumbnails ofNone or more images in a file directory. Rather than displaying each individualGimage at its full resolution, you can browse the visual image directoryIand choose an image to display. You can create a VID with either of thesecommands:
3
    montage *.jpg directory.vid:    convert 'vid:*.jpg' directory.vid
YOf course you can substitute any filenames you desire. MontageJhas many relevant command line options. You can exercise more control overGthe appearance of the VID than with convert.

Next display the directory:3

    display directory.vid
FFinally browse and select an image to display. Move the pointer to theimage and press button 3.6

You can create the VID directory with this command:1

    display 'vid:*.jpg'
GYou can also select Visual Image... from the File menu ofthe command widget.O

Note, that creating a VID is time consuming. Creating them on-the-flyKwithin display may be less convenient than usingHmontage or convertF. Also, if you create them with montage. orMconvert, you can reuse them as often as necessary.I

Note that a visual image directory is useful for looking at individualframes of an image sequence:3

    display vid:movie.mpg




K14. I have an HP. How do I take advantage of the ColorRecovery option?



Type
:
    display -map list image.miff
kIf 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, type8
    display +dither image.miff




K15. I use the window ID reported by xwininfo(1)Iwith import and it does include the window manager frame as expected. How1can I save the window with its frame?



IBy default, xwininfo(1) returns the ID of the window you click on.BUse the -frame option to get the reparented window ID:
-
    xwininfo -frame
NYou can then use the returned window ID with import:B
    import -frame -window ID window.miff




I16. I displayed an image and it appears as one solid'color. What did I do wrong?



HA blank image generally means that the image is either corrupt or it has2a matte channel and the matte values are all zero.ImageMagick treatsHa matte value of zero as completely transparent. To determine if this isthe problem, try
7
    display +matte image.miff




H17. I received the following message, "???? library5is not available ...". What does it mean?



OImageMagick requires source libraries not included with the distributionHto view or convert certain image formats such as JPEG or TIFF. The aboveHmessage means you did not compile the required library and link with the!ImageMagick utilities. See%README forFthe location of these libraries and compiling instructions. Next, editMMagick.tmpl if you use xmkmf or set the appropriate commandline arguments to9configure and uncomment the appropriate delegate)defines as instructed. Finally, type
&
    cd ImageMagick    rm displayG    rm magick/decode.o magick/encode.o magick/compress.o    make
GMake sure the compile command line includes the appropriate define. ForGexample, with JPEG the compile line should have -DHasJPEG. TheHlink line should include the library path and name. For JPEG, this mightFbe -Ljpeg -ljpeg. Also, make sure the clients link to the newIImageMagick library. In particular, with shared libraries the compile mayFlink to a system version of libMagick.so. In this case, type:!
    cd magick    make install    cd ..%    make install




J18. I want to inspect the values of the matte channel/within my image. How can I do that?



IView the matte image as a gray scale image. Suppose you have a TIFF imageFthat has a matte channel and is 640 pixels in width and 480 in height. Type:
6
    convert image.tiff image.matte?    display -size 640x480 gray:image.matte




K20. How can I add one of those cool bevels to my image'that I see used on the Web?



IThere are four types of ornamental borders you can add to your image withJImageMagick. Each is listed below with the procedure to use them with your image.








G21. I try to launch display from my window manager$and it fails. What's up?



NDisplay determines if it is executing interactively<and behaves differently depending on the result. To convince"displayJyou are running in an interactive environment when launching from a windowmanager, use either of
-
    display logo:Untitled2    display < /dev/console




I22. When I convert Postscript to another format, how5can I improve the appearance of the text?



GSimple. Increase the dots-per-inch when converting and sub-sample:
S
    convert -density 288 -geometry 25% image.ps image.png
HChange the density to 144 and geometry to 50% if the above command failsLdue to insufficient memory. Alternatively, see the Ghostscript documentationabout using high-quality fonts.H

The -density option increases the number of pixels (or dots)Kgenerated by Ghostscript when processing the input postscript file. HoweverHas all other images formats are generally displayed on screens which areItypically about 72 to 100 dots per inch, the output image will be larger.L

The -geometry option reduces the large image output of ghostscriptFimage back to a normal 72 dpi resolution (25% of 288 dpi gives 72 dpi)Gbut in the process anti-aliases (or smooths) the fonts and lines of theGimage so as to remove the jaggies you would otherwise get from a&normal postscript to image conversion.





F23. How can I annotate an image with text that is2 to 3 inches tall?



KIf you do not access to a particular named font that is large, try scalable:fonts. First see if you have any scalable fonts. Type
8
    xlsfonts -fn '*-0-0-0-0-*'

DOr if you are using display, use the fontIpattern above within the Font Browser (see Image Edit->Annotate). NextHsubstitute the appropriate resolution. Keep in mind that a scalable fontJmust be fully qualified to work. That is, all 14 fields must be specified.JHere is one example where we annotate an image with large Helvetica text:
W
    convert -font '-*-helvetica-*-*-*--300-300-*-*-*-*-iso8859-1' \b      -pen green -draw 'text 50,300 Magick' image.png annotated.png
FIf you have the FreeType support built into ImageMagick, just increaseyour pointsize and/or density:I
  convert -font @ArtBrush -pointsize 100 -density 300 ...




G24. How can I convert my GIF animation sequence to#individual image files?



PUse the scene embedded file format with convert:
A
    convert animation.png frame%02d.png

PThe resulting image files are titled frame01.png, frame02.png,frame03.png, etc.







K25. How can I remove the background that prints around5my image when I display it with Netscape?



GUse the +page option of the convert command:
>
    convert +page alpha.png beta.png

IGIF allows for a page offset relative to some background. The page offsetIinformation may have been in your GIF image already or it could have beenJintroduced by ImageMagick. Either way, +page removes the unwanted8page offset and Netscape should behave as expected.







V26. How do I create a GIF image with Web safe colors?



FUse the -map option of the convert command:
G
    convert -map netscape: alpha.png beta.png

DNetscape predefines 216 colors for colormapped workstations. Use theHabove command to ensure only these predefined colors are used. OtherwiseHNetscape dithers your image with varying degrees of image fidelity.







L27. How come Adobe Acrobat 2.1 can't read ImageMagick'sPDF format?



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




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



>One way is to use a bitmap as your transparency mask. Try
^
    combine -compose ReplaceMatte image.png mask.xbm transparent.png

HNote, GIF is limited to one transparent color. If your mask has variableNopacity, use a format like MIFF, TIFF, or PNG as you output image format.



Home Page Image3manipulation software that works like magic.