displaywill display an image in just about any format imaginable on a Unix workstation; just type
and the image will appear in a window. Another way to view some images is to load them into your Web browser, but this obviously only works for images in a format that your browser can display (GIF, or in some cases JPEG).
displayprogram you can find out information about the image by selecting the Image Info option from the menu that appears when you press the right mouse button with the cursor over the image.
You can also use the ImageMagick
to find out certain details about an image from the command line, as in:
% identify sample.gif
sample.gif 303x192 PseudoClass 256c 46026b GIF 1s
convertdoes this. It can handle a huge variety of formats. It takes two arguments --- the input file first, and the output file second. It deduces the format to convert to by looking at the extension (everything after the ".") in the second filename. So for example, to convert a PICT file to GIF:
Convert takes lots of options to specify how the conversion is to be done, and it can do a lot of things in addition to just converting between file formats. Some of these other operations are described below; see its man page for all the details.
convert image.pict image.gif
displayallows you to interactively select a region of an image for cropping. To use this feature, run
displayon your image, and select the Crop option from the right-mouse menu, and then use the left mouse button to define your cropping rectangle. When you are happy with the rectangle, hit the Crop button in the Commands window. You can then save the resulting cropped image via the File->Save menu in the Commands window.
-cropoption to the ImageMagick
convertprogram. For example, to extract a 200 X 100 rectangle whose upper left corner is at pixel coordinate (300,400) from an image called
image.gif, use the command:
convert -crop 200x100+300+400 image.gif newimage.gif
convertprogram does scaling easily with its
-geometryoption. For example, to scale an image to be exactly 640 X 480 pixels, give the command
Note that this command overwrites the file
convert -geometry 640x480! image.gif image.gif
image.gifwith the scaled image; if you want to save the scaled image in a new file rather than overwriting the original one, specify a new name for the second file on the command line.
! after the size specification in the command above
convert to force the resulting image to be exactly
640 X 480. Without the
!, convert will scale the image
as much as possible to fit within the given size without altering its
aspect ratio, so the result may not be exactly 640 X 480.
There are other ways to specify scaling factors and sizes in the
convert program; see its
man page for
convertprogram will interlace an image when given the
-interlacing PLANEoption. For example,
will replace the file
convert -interlacing PLANE image.gif image.gif
image.gifwith an interlaced image. (The word
PLANEspecifies the kind of interlacing to do;
convertcan do two different kinds, but for GIF images for use on the Web it doesn't matter which one you do.)
As usual, ImageMagick's
convert program can add
transparency to images:
will change all white pixels in
convert -transparency white image.gif image.gif
image.gifto be transparent. You can also specify the color to be made transparent using hexadecimal RGB values, for example
-transparency #faf7efwill make all pixels containing color
#faf7eftransparent. See the COLOR NAMES section of the X man page for details on how to specify RGB colors in this way.
You can use ImageMagick's
display program to find out
the RGB color value of a particular pixel in an image; just press
the middle mouse button with the cursor over the desired pixel.
The ImageMagick program
display lets you do a limited
amount of image touchup and painting; use the Image Edit
menu on the Commands window. (Click the left mouse button
in the image to make the Commands window appear if it
is not already visible).
Created: May 31 1996 --- Last modified: Tue Jun 4 15:27:39 1996