ImageMagick-3.6.3 Frequently Asked Questions

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

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

ImageMagick uses several freely available packages to perform the translation 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. If not, set the TMPDIR environment variable to an area where space is available. Finally, for PostScript, verify that the document contains valid PostScript statements.

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

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 the color reduced image closely resemble the original. However, there are some options that may improve the appearance.

You can use a private colormap. By default, your image must share colors 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
The disadvantage is the annoying colormap loading and unloading as you move your pointer in and out of the image window.

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

      display -colorspace YCbCr image.miff

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

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

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

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

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

      point
      replace
      floodfill

The point method changes the matte value of any pixel selected with the pointer until the button is is released. The replace method changes the matte value of any pixel that matches the color of the pixel you select with a button press. Floodfill changes the matte value of any pixel that matches the color of the pixel you select with a button press and is a neighbor.

Select your transparent pixel with the pointer and press a button. The 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.

Finally, choose Write from the command menu and write your GIF image to a file. Note that setting transparency works best on a TrueColor or DirectColor visual. If your server only exports colormapped visuals you will need to use a Standard Colormap to set transparency.

      xstdcmap -best
      display -map list image.gif
      < choose Matte Edit >
      < select your transparent pixel then press Return >
      < choose Write >
If 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?

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

      animate -title "My Image Sequence" images.
5. The image grabbed by import(1) does not look like the image on my X server. What's wrong?

Use the -desend 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 colors in some areas. This can happen when a subwindow has a different colormap than its parent. With -descend, import descends 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 guarentees the correct image.

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:

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

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

      display -gamma 1.0,0.0,0.0 image.miff

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

The default dimensions of a PostScript page is 612x792. If you prefer another default, change the page geometries in magick/image.h and recompile.

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

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

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

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

10. How do I concatenate two images left-to-right with no borders frames or text?

Assume your two images are called image1.ppm and image2.ppm. Type

    montage +display -borderwidth 0 -geometry 256x256! \
        image1.ppm image2.ppm concatenated.ppm
Choose a geometry which is appropriate for your images.

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

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

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

ImageMagick automatically trims any PostScript image as defined by the bounding box. To preempt this behavior, explicitly set the page size. For example,

      display -page letter image.ps

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

A visual image directory (VID) is an image that contains thumbnails of 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 command line option. You can exercise more control over the appearance of the VID than with convert.

Next display the directory:

      display directory.vid

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

You can create the VID directory with this command:

      display 'vid:*.jpg'

You can also select Visual Image... from the File menu of the command widget.

Note, that creating a VID is time consuming. Creating them on-the-fly within display may be less 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

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

Type

      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

      display +dither image.miff

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

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
You can then use the returned window ID with import:

  import -frame -window ID window.miff

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

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

  display +matte image.miff

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

ImageMagick requires source libraries not included with the distribution 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 utilites. See README for the location of these libraries and compiling instructions. Be sure to delete decode.o and encode.o before recompiling:

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

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

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

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

[home page]