
The ECN No Name Newsletter is no longer being published.
This is an archived issue.
[previous article]
[next article]
ImageMagick: Digital Image Manipulation
Aaron Roswarski
roswarsk@ecn.purdue.edu
ImageMagick is a freely-distributed collection of image modification tools
available for most UNIX variants, including Linux.
There are also versions available for Windows NT, Macintosh and VMS.
This software is standard on most UNIX machines serving Engineering
and is part of the Common UNIX Environment (CUE)
set up by the ECN and the PUCC.
Information about ImageMagick is available on the Engineering web.
The URL's are:
http://www.ecn.purdue.edu/ECN/Documents/Magick/
and
http://www.ecn.purdue.edu/ECN/Newsletters/1995.May/
The basics for using ImageMagick:
-
To begin,
a digital image format is necessary. One method for achieving this is scanning
in the image. Image scanners are available at no charge to Purdue students,
staff and faculty in LAEB Mac and PC labs. Scanners are also available for pay
at some off-campus businesses. Save your image as a TIFF. This format will save
the most amount of information, and permits conversion to other formats (see
step #4).
-
Move the image file to your account. Use FTP from an internet-connected
computer. Remember to switch to binary! Moving the file as
ASCII corrupts the image.
-
To start ImageMagick, add to your path
/usr/local/bin/magick
and then type
display file.tiff
from the command line. If ImageMagick is not in your path, it will be
necessary for you to call the package from the command line by typing:
/usr/local/bin/magick/display file.tiff .
-
Reformatting Files
One of the first things you will want to do to your image is to
change the file format.
While the TIFF format is best to scan with,
TIFF's are not the most practical to store because they
take up too much space.
This could result in exceeding your account quota.
3
Click anywhere on
the image with the left mouse button to bring up a menu
for editing your image.
Select file then save.
At the bottom of the next screen,
select format.
A new dialog box will appear listing formats.
Select GIF or JPEG and double click,
then select save.
Your TIFF file has been reformatted to a GIF or JPEG file,
which takes much less space and is accepted by most browsers.
This action does not delete the original TIFF file.
To save storage space, remove the TIFF file.
-
Resizing Files
You may want to resize your image.
This is done via the main menu.
Go to View and then to any of the resizing options.
When using the Resize option,
you may change one of the
numbers and the other will change itself to keep the correct height to
width ratio. You can change the ratio by changing both numbers to whatever
you wish and then adding a "!" at the end of the line.
-
Three useful image altering commands are
flip, flop, and rotate.
These commands are all found within the Transform button on the main
menu.
Other ImageMagick commands include:
Crop Chop Cut Size
Shear Spiff Dull Equalize
Normalize Negate Grayscale Quantize
Despeckle Sharpen Blur Edge
Detect Emboss Oil Paint Raise
Segment Annotate Draw Color
Mat Hue Saturation Brightness
Gamma Peak Noise Composite
Borders and frames can also be added.
Placing An Image On Your Web Page
Let's say you have a picture that you would like to put up on your homepage.
-
If you do not have a homepage, the easiest remedy is to move to your home
directory on your Sun or HP workstation and type webinit .
This will automatically create a public-web directory and
all necessary support files for a properly operating web site.
Information about webinit can be found at
http://www.ecn.purdue.edu/ECN/FAQ/internet/web_authoring_and_cgi/personal.homepage/How_do_I_create_a_personal_homepage
-
After you have prepared your image,
move the image into your public-web directory.
Remember, you need to be sure the image file permissions are
set to world readable.
To accomplish this, type chmod 644 file.gif .
webmaster@ecn.purdue.edu
Last modified: Saturday, 02-Oct-99 10:25:38 EST
HTML