Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



IMAGEMAGICK


ImageMagick is an ultra versatile tool that can manipulate images on the commandline.
You will find it installed by default in most distros. Just to give you an idea what it can do, here is a few examples:

import - Take a screenshot of the full desktop:

CODE
$ import -window root screenshot.png

( When the command is typed in a 'run-box' and you click on the desktop it will take the full desktop too and you won't see the open terminal where you typed the command )

Takes screenshot of an open window:

CODE
$ import screenshot.png

Then click on a window.

Take a screenshot of any ( detail ) part of the desktop:

CODE
$ import screenshot.png

Then make a selection with your right mouse button.

A simple way to display the screenshot: ( or any other image )

CODE
$ display sceenshot.png




Now comes the real 'magic':

mogrify - To transform a .png image to .jepg:

CODE
$ mogrify -format jpeg screenshot.png


To transform a whole series of .png images to .jpeg:

CODE
$ mogrify -format jpeg *.png


NOTE: Imagemagic can handle and transform all possible image formats ! ( See below )

And to make a series of thumbnails:

CODE
$ mogrify -geometry 120x120 *.jpg

( Don't worry about disfiguring the image, it will take the first number and adapt the second one to it to make sure the proportions stay the same )


WARNING:
"mogrify" overwrites the original image, so make a backup before you start !


What else can it do?
- Resize, rotate, sharpen, color reduce, or add special effects to an image
- Create a montage of image thumbnails
- Create a transparent image suitable for use on the Web
- Turn a group of images into a GIF animation sequence
- Create a composite image by combining several separate images
- Draw shapes or text on an image
- Decorate an image with a border or frame
- Describe the format and characteristics of an image

Here are the commands you can use in Imagemagic:

QUOTE (Info @ Homepage)

display is a machine architecture independent image processing and display facility. It can display an image on any workstation display running an X server.

import reads an image from any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen.

montage creates a composite by combining several separate images. The images are tiled on the composite image with the name of the image optionally appearing just below the individual tile.

convert converts an input file using one image format to an output file with the same or differing image format while applying an arbitrary number of image transformations.

mogrify transforms an image or a sequence of images. These transforms include image scaling, image rotation, color reduction, and others. The transmogrified image overwrites the original image.

identify describes the format and characteristics of one or more image files. It will also report if an image is incomplete or corrupt.

composite composites images (blends or merges images together) to create new images.

compare compares an image to a reconstructed image.

conjure interprets and executes scripts in the Magick Scripting Language (MSL).



The formats ImageMagick can handle:

8BIM - Photoshop resource format
AFM - TrueType font
APP1 - Photoshop resource format
ART - PF1: 1st Publisher
AVI - Audio/Visual Interleaved
AVS - AVS X image
BIE - Joint Bi-level Image experts Group interchange format
BMP - Microsoft Windows bitmap image
CAPTION - Caption (requires separate size info)
CMYK - Raw cyan, magenta, yellow, and black samples
CMYKA - Raw cyan, magenta, yellow, black, and matte samples
CUT - Dr Halo
DCM - Digital Imaging and Communications in Medicine image
DCX - ZSoft IBM PC multi-page Paintbrush
DIB - Microsoft Windows bitmap image
DPS - Display PostScript
DPX - Digital Moving Picture Exchange
EPDF - Encapsulated Portable Document Format
EPI - Adobe Encapsulated PostScript Interchange format
EPS - Adobe Encapsulated PostScript
EPS2 - Adobe Level II Encapsulated PostScript
EPS3 - Adobe Level III Encapsulated PostScript
EPSF - Adobe Encapsulated PostScript
EPSI - Adobe Encapsulated PostScript Interchange format
EPT - Adobe Encapsulated PostScript with TIFF preview
FAX - Group 3 FAX
FILE - Uniform Resource Locator
FITS - Flexible Image Transport System
FPX - FlashPix Format
FTP - Uniform Resource Locator
G3 - Group 3 FAX
GIF - CompuServe graphics interchange format
GIF87 - CompuServe graphics interchange format (version 87a)
GRADIENT - Gradual passing from one shade to another
GRANITE - Granite texture
GRAY - Raw gray samples
H - Internal format
HDF - Hierarchical Data Format
HISTOGRAM - Histogram of the image
HTM - Hypertext Markup Language and a client-side image map
HTML - Hypertext Markup Language and a client-side image map
HTTP - Uniform Resource Locator
ICB - Truevision Targa image
ICM - ICC Color Profile
ICO - Microsoft icon
ICON - Microsoft icon
IPTC - IPTC Newsphoto
JBG - Joint Bi-level Image experts Group interchange format
JBIG - Joint Bi-level Image experts Group interchange format
JP2 - JPEG-2000 JP2 File Format Syntax
JPC - JPEG-2000 Code Stream Syntax
JPEG - Joint Photographic Experts Group JFIF format
JPG - Joint Photographic Experts Group JFIF format
LABEL - Text image format
LOGO - ImageMagick Logo
M2V - MPEG-2 Video Stream
MAP - Colormap intensities
MAT - MATLAB image format
MATTE - MATTE format
MIFF - Magick image format
MNG - Multiple-image Network Graphics
MONO - Bi-level bitmap in least-significant-byte-first order
MPC - Magick Persistent Cache image format
MPEG - MPEG-1 Video Stream
MPG - MPEG-1 Video Stream
MPR - Magick Persistent Registry
MSL - Magick Scripting Language
MTV - MTV Raytracing image format
MVG - Magick Vector Graphics
NETSCAPE - Netscape 216 color cube
NULL - Constant image of uniform color
OTB - On-the-air bitmap
P7 - Xv thumbnail format
PAL - 16bit/pixel interleaved YUV
PALM - Palm Pixmap format
PBM - Portable bitmap format (black and white)
PCD - Photo CD
PCDS - Photo CD
PCL - Page Control Language
PCT - Apple Macintosh QuickDraw/PICT
PCX - ZSoft IBM PC Paintbrush
PDB - Pilot Image Format
PDF - Portable Document Format
PFA - TrueType font
PFB - TrueType font
PFM - TrueType font
PGM - Portable graymap format (gray scale)
PICON - Personal Icon
PICT - Apple Macintosh QuickDraw/PICT
PIX - Alias/Wavefront RLE image format
PLASMA - Plasma fractal image
PM - X Windows system pixmap (color)
PNG - Portable Network Graphics
PNM - Portable anymap
PPM - Portable pixmap format (color)
PREVIEW - Show a preview an image enhancement, effect, or f/x
PS - Adobe PostScript
PS2 - Adobe Level II PostScript
PS3 - Adobe Level III PostScript
PSD - Adobe Photoshop bitmap
PTIF - Pyramid encoded TIFF
PWP - Seattle Film Works
RAS - SUN Rasterfile
RGB - Raw red, green, and blue samples
RGBA - Raw red, green, blue, and matte samples
RLA - Alias/Wavefront image
RLE - Utah Run length encoded image
ROSE - 70x46 Truecolor test image
SCT - Scitex HandShake
SFW - Seattle Film Works
SGI - Irix RGB image
SHTML - Hypertext Markup Language and a client-side image map
STEGANO - Steganographic image
SUN - SUN Rasterfile
SVG - Scalable Vector Gaphics
TEXT - Raw text
TGA - Truevision Targa image
TIF - Tagged Image File Format
TIFF - Tagged Image File Format
TILE - Tile image with a texture
TIM - PSX TIM
TTF - TrueType font
TXT - Raw text
UIL - X-Motif UIL table
UYVY - 16bit/pixel interleaved YUV
VDA - Truevision Targa image
VICAR - VICAR rasterfile format
VID - Visual Image Directory
VIFF - Khoros Visualization image
VST - Truevision Targa image
WBMP - Wireless Bitmap (level 0) image
WMF - Windows Metafile
WPG - Word Perfect Graphics
X - X Image
XBM - X Windows system bitmap (black and white)
XC - Constant image uniform color
XCF - GIMP image
XML - Scalable Vector Gaphics
XPM - X Windows system pixmap (color)
XV - Khoros Visualization image
XWD - X Windows system window dump (color)
YUV - CCIR 601 4:1:1

Now you know why it is called "ImageMagick"



Bruno


Info: ImageMagick.org
Basic Usage: ImageMagick Usage
Also: Graphics from the command line
Links: ImageMagick Tutorial Links



-- Apr 7 2004 ( Revised Jan 20 2009 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email