5ImageMagick Frequently Asked Questions,
/

ImageMagick Frequently Asked Questions




    G
  1. I received the following message, "?????? translation) failed ...". What does it mean?C
  2. How can I improve the appearance of 24-bit images0displayed on my colormapped X server?>
  3. How do I set the transparency index in a GIF0image so it displays properly within Mosaic?C
  4. How can I stop the filenames from changing in the-title bar of the animate(1) image window?M
  5. The image grabbed by import(1) does not look like the image(on my X server. What's wrongD
  6. How do I animate a digital YUV image sequence?>
  7. How do I view only the red channel of an RGB image? N
  8. How do I change the default PostScript page size?A
  9. I am trying to display a sequence of 100 images,and I run out of memory. What can I do?B
  10. How do I concatenate three images left-to-right%with no borders, frames, or text?C
  11. Unfortunately I have no choice but to work on anLRS6000 under AIX. Display(1) hangs the X server. What can I do?I
  12. When I display a PostScript image it appears toJbe trimmed. I would like the display the entire page, including any white space.C
  13. What are visual image directories? How do I use them?@
  14. I have an HP. How do I take advantage of theColor Recovery option?2
  15. I use the window ID reported byKxwininfo(1) with import and it does include the window manager frame;as expected. How can I save the window with its frame?C
  16. I displayed an image and it appears as one solid color. What did I do wrong?B
  17. I received the following message, "???? library.is not available ...". What does it mean?<
  18. I want to inspect the values of the matte0channel within my image. How can I do that?G
  19. Why was LZW compression removed from the ImageMagickdistribution?




B
1. I received the following message, "??????4translation failed ...". What does it mean?

L

ImageMagick uses several freely available packages to perform theLtranslation of certain image formats (PostScript, PICT, etc.).:Make sure these packages are available as described in the! README@file. Also verify that you have plenty of temporary disk space.BIf not, set the TMPDIR environment variable to an area where spaceFis available. Finally, for PostScript, verify that GhostscriptHsupports the ppmraw device (gs -h) and that the documentCcontains valid PostScript statements (gs image.ps).




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

M

If you have a colormapped X server, the number of unique colors in@an image must first be reduced to match the requirements of your&server before it can be displayed. Display tries to make theBcolor reduced image closely resemble the original. However, there1are some options that may improve the appearance.

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



*      display -colormap private image.miff
BThe disadvantage is the annoying colormap loading and unloading as5you move your pointer in and out of the image window.

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



*      display -colorspace YCbCr image.miff


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



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


BThis forces the time-consuming process of color reducing the image:to one-time, rather than each time the image is displayed.




J
3. How do I set the transparency index in a GIF image.so it displays properly within Mosaic?

"

Display your GIF image with display. ChooseIMatte from the Image Edit command menu and identify a pixelIthat has the transparency color. Press Method and select aBmatte 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 withGthe pointer until the button is is released. The replace methodBchanges the matte value of any pixel that matches the color of theIpixel you select with a button press. Floodfill changes the matteAvalue of any pixel that matches the color of the pixel you select&with a button press and is a neighbor.

BSelect your transparent pixel with the pointer and press a button.AThe image is redisplayed with any transparent pixels recolored to>the background color. You can select other pixels or areas to<force to transparent. When you are satisfied, press Return.

DFinally, choose Save from the command menu and write your GIFDimage to a file. Note that setting transparency works best on aBTrueColor or DirectColor visual. If your server only exportsJcolormapped visuals you will need to use a Standard Colormap to set transparency.



      xstdcmap -best!      display -map list image.gif        choose Matte Edit  9        select your transparent pixel then press Return          choose Save
6If you do not have the xstdcmap(1) program, try



)      display -visual TrueColor image.gif


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

'

Animate3updates the image file name in the title bar of the@image window as each image is displayed from the image sequence.FTo display just a single name that will not change, use -title:



0      animate -title "My Image Sequence" images.


I
5. The image grabbed by import(1) does not look like7the image on my X server. What's wrong?

#

Use the -descend option:



       import -descend image.miff
or set this X resource:



      import.descend:  True


:By default, import quickly grabs.the image from the X server. However, )it may not always have the correct colors6in some areas. This can happen when a subwindow has a:different colormap than its parent. With -descend, import3descends the window hierarchy. Descending involves;grabbing the image and 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 but ensures the correct image.




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

?

Suppose your sequence is 72 352x240 frames titled frame0.Y,?frame0.U, frame0.V, frame1.Y, frame1.U, etc. Use this command:



8      animate -geometry 352x240 -scene 0-71 yuv3:frame%d





D
7. How do I view only the red channel of an RGBimage? 

.

Use the -gamma option, for example,



+      display -gamma 1.0,0.0,0.0 image.miff





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

J

The default dimensions of a PostScript page is 612x792. If youKprefer another default, change the page geometries in magick/image.hand recompile.




K
9. I am trying to display a sequence of 100 images and,I run out of memory. What can I do?

B

The simplest thing to do is to increase your virtual memory byexpanding your swap partition.

JImageMagick is designed to be general purpose. It can display manyGimage storage formats (Monochrome, PseudoColor, or TrueColor) onEmany different types of X visuals (StaticGray, StaticColor,NPseudoColor, GrayScale, DirectColor, or TrueColor). To support all@these combinations of image storage formats and X visuals, extraCmemory is required. In fact, each image requires 6 bytes per pixel%to store in memory. Additionally, animate and montage store an entire imagesequence in memory.

@For animation, consider using the MPEG programs from Berkeley if(you encounter memory limitations with animate. 4It only stores a few frames at a time in memory. Convert has an option to create theGproper CCIR 601 2:1:1 files as input to the MPEG program. However, theHCCIR 601 2:1:1 image format is lossy. Computer generated images may notlook very good.




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

<

Assume your three images are called image1.ppm,3image2.ppm, and image3.ppm. Type



>      montage +frame +shadow +label -geometry +0+0 -tile 3x1 \:        image1.ppm image2.ppm image3.ppm concatenated.miff


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

4For more control over the placement of an image, useLcombine. First create a matte image and position)your images onto the matte. For example,

3      convert -size 350x500 xc:black composite.miffG      combine -geometry +0+0   image1.gif composite.miff composite.miffG      combine -geometry +100+0 image2.gif composite.miff composite.miffG      combine -geometry +0+300 image3.gif composite.miff composite.miffG      combine -geometry +0+375 image4.gif composite.miff composite.miff





P
11. Unfortunately I have no choice but to work on an RS6000Eunder AIX. Display hangs the X server. What can I do?

<

Display is fine. The problemFis a bug in the AIX X11-R5 runtime environment. Contact AIX defective,support and ask for PTF U427948 and U433804.




D
12. When I display a PostScript image itKappears to be trimmed. I would like the display the entire page, includingany white space.

I

ImageMagick automatically trims any PostScript image asKdefined by the bounding box. To preempt this behavior, remove the bounding6box statement from the Postscrpt or explicitly set thepage size. For example,



#      display -page letter image.ps





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

G

A visual image directory (VID) is an image that contains thumbnailsBof one or more images in a file directory. Rather than displaying@each individual image at its full resolution, you can browse the?visual 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


:Of course you can substitute any filenames you desire. Montage has many relevant commandJline option. You can exercise more control over the appearance of the VID-than with convert.

Next display the directory:



      display directory.vid


CFinally 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'


KYou can also select Visual Image... from the File menu of thecommand widget.

DNote, that creating a VID is time consuming. Creating them;on-the-fly within display may beless convenient than using montage or convert . Also, if you create them/with montage. or 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





F
14. I have an HP. How do I take advantage of theColor Recovery option?



Type



"      display -map list image.miff
If you want to use Color Recovery all the time, put this in your Xdefaults file:



      display.map: list


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

       display +dither image.miff





P
15. I use the window ID reported by xwininfo(1) withKimport and it does include the window manager frame as expected. How can I'save the window with its frame?

M

By default, xwininfo(1) returns the ID of the window you click on.=Use the -frame option to get the reparented window ID:



      xwininfo -frame
NYou can then use the returned window ID with import:



*      import -frame -window ID window.miff





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

E

A blank image generally means that the image is either corrupt or9it has a matte channel and the matte values are all zero.=ImageMagick treats a matte value of zero as completely6transparent. To determine if this is the problem, try



      display +matte image.miff





K
17. I received the following message, "???? library is/not available ...". What does it mean?

F

ImageMagick requires source libraries not included with theBdistribution to view or convert certain image formats such as JPEGBor TIFF. The above message means you did not compile the required<library and link with the ImageMagick utilities. See! README'for the location of these libraries and@compiling instructions. Be sure to delete decode.o and encode.obefore recompiling:



      cd ImageMagick(      rm magick/decode.o magick/encode.o
      make





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

C

View the matte image as a gray scale image. Suppose you have aBTIFF image that has a matte channel and is 640 pixels in width and480 in height. Type:



$      convert image.tiff image.matte,      display -size 640x480 gray:image.matte



N
19. Why was LZW compression removed from the ImageMagickdistribution? 


=

LZW compression is no longer available in the ImageMagick=distribution (GIF pixel data is saved uncompressed). I am inagreement withD L. Peter Deutsch's arguments!regarding LZW within Ghostscript:



    D
  • Unisys claims that they have the right to demand licenses@and/or fees from free software incorporating the LZW algorithms,>even though they are currently not doing this. This will hang@over the head of the developer of any free software that creates=GIF files until the Welch patent expires on December 10, 2002 (17 years after its award date).

    B

  • I wish to support the industry move from GIF to PNG. The next6Aladdin Ghostscript release (and possibly the next GNU6Ghostscript release as well) will include PNG drivers;?experimental PNG drivers for Ghostscript are already available.=More generally, I wish to support any industry move away from>reliance on patented software, which my studies have led me to?consider a bad deal for everyone except a few lawyers and a fewvery large companies.

    C

  • While Unisys' press release says they will not seek licenses or>fees from "non-commercial, non-profit" distributors, it is not:at all clear to me that they would also exempt people likeDWalnut Creek CD-ROM, FSF, or Yggdrasil, who distribute free=software but charge for the media and documentation. FSF and@Yggdrasil, at least, would not redistribute GIF code under those8circumstances. This would have a very bad effect on the8availability of Ghostscript. I also believe, given that?CompuServe gave in to Unisys' demands, that Unisys might demand<licenses and fees from any commercial ISP (Netcom, AOL, ...)3that distributed free software containing LZW code.

    .

  • Unisys' conditions are not compatible with8the GNU License, since they restrict recipients' rights.


FA kit is available to enable LZW compression for GIF, Postscript Level>II, and the Portable Document Format within ImageMagick. SendLelectronic mail to cristy@dupont.comwith



      send LZW


Fas the subject. Note, this kit may not be redistributed. This7service may be discontinued without notice at any time.








4[home page]