Fred's ImageMagick Scripts



 

 

  • The following (bash) scripts are available free of charge for non-commercial use. Detailed information and examples are available for each on separate pages linked below as well as a summary list of them all.

  • Licensing - If you redistribute or incorporate any of these scripts into other free applications, you may use my scripts by simply referencing my name and this web page: Fred Weinhaus and http://www.fmwconcepts.com/imagemagick/index.html.

    For use of my scripts in commercial, non-free applications, please contact me for licensing arrangements.

  • To download a script, go the examples page for that script and simply click on the link. The links are controlled by a counter script and are set to download automatically upon a single left button click.

  • These scripts are bash unix shell scripts and should work on Linux and Mac OSX.

    Pointers for use:
    1. Download the script
    2. Change the name to add or remove the .sh as desired when running
    3. Set the script to executable (chmod u+x)
    4. Be sure your PATH contains the location of IM convert
    5. Open a shell terminal window
    6. bash /fullpathto/scriptname(.sh) arguments /fullpathto/inputimage /fullpathto/outputimage
    7. To avoid the bash and just use scriptname(.sh) ... set your PATH to contain the location of the script
    8. Optionally edit the script to change the default directory (found after the defaults section) from dir="." to dir="/tmp"

  • Windows users should be able to run the scripts, if they install Cygwin or some other unix system for Windows and then install the IM Cygwin binary or compile IM for unix in your Cygwin system. More practical information about using bash shell scripts under Cygwin on Windows has been provided by Wolfgang Hugemann in his excellent page, Usage Under Windows

  • My earliest scripts were developed under ImageMagick-6.3.5.0 on Mac OS 10.4x. I have tried to keep them updated with changes in IM versions. All were developed using Q16 IM. I do not know how compatible they are to older version of ImageMagick, nor to other Q levels or other versions of Unix.

  • Use at your own risk. The argument testing may not be foolproof nor do I bear any responsibility for any problems that may occur by their use.

  • I would like to thank Anthony Thyssen for his patience with all my newbie questions about IM and Unix. His replies were invaluable.

  • My background involves image processing with a specialty in image perspective transformations from arial photography. For details, see my personal information page.

  • I have also written a digital image filtering tutorial (2MB PDF). It supplements the description of the following scripts below with more mathematical detail: binomial, derivative, gradient, laplacian, statsfilt, isonoise, sharp and space.

  • And I have created a tutorial for Fourier Transform Processing With ImageMagick. It supplements the description of the following scripts below with more mathematical detail: spectrum, fftconvol, fftdeconvol, fftfilter, cepstrum, camerablur, cameradeblur, normcrosscorr and notch.

  • Also see my ImageMagick Tidbits pages.

  • Comments and bug reports are always welcome. My contact information is fmw at alink dot net

  • If you find any of these scripts are particularly useful, please let the folks at ImageMagick know. Perhaps they will consent to implement them as IM functions.

  • NOTE: I fix problems that I find with the scripts or make improvements often. So please check the last modified dates below or the revision dates in the scripts for updates.
  • Latest Updates:

    • sphere: Mar 7, 2010 - added new script to create a colored sphere with a combination of diffuse and specular illumination
    • separate: Feb 25, 2010 - added new script to identify each separate white shape in a binary image
    • 3Dreflection: Feb 6, 2010 - added new script to place text automatically in a specified square size region that has the least color variation
    • autocaption: Feb 3, 2010 - added new script to place text automatically in a specified square size region that has the least color variation
    • multicrop: Jan 30, 2010 - added new script to crop and unrotate multiple images from a scanned image
    • notch: Jan 24, 2010 - added new script to create and apply a notch filter to an image in the frequency domain to remove dither-like patterns
    • uwcorrect: Jan 14, 2010 - added new script to correct the color balance for red light attenuation in pictures taken underwater
    • bumptext: Jan 7, 2010 - added new script to applies a raised text effect onto an image
    • similar: Dec 30, 2009 - added new script to compute the normalized cross correlation similarity metric between two equal sized images
    • downsize: Dec 24, 2009 - added new script downsize (reduce) an image to a specified file size
    • autolabel: Dec 12, 2009 - added new script to place text automatically in a specified size region that best matches a reference color
    • aspectpad: Dec 1, 2009 - added new script to pad an image with a color to a specified aspect ratio and orientation
    • colorconverter: Oct 1, 2009 - added new script to convert any valid ImageMagick color specification to other color representations
    • slice: Sep 22, 2009 - added new script to threshold an image between a range of graylevels and optionally colorize
    • perlin: Aug 31, 2009 - added new script to create an image composed of Perlin type noise
    • normcrosscorr: Aug 25, 2009 - added new script to perform template matching using normalized cross correlation in the frequency domain
    • cameradeblur: Aug 22, 2009 - added new script to remove motion blur or defocus in an image in the frequency domain
    • camerablur: Aug 22, 2009 - added new script to apply motion blur or defocus to an image in the frequency domain
    • cepstrum: Aug 19, 2009 - added new script to create the cepstrum to depict the type, amount and orientation of camera type blurring
    • fftfilter: Aug 18, 2009 - added new script to perform filtering on an image in the frequency domain
    • fftdeconvol: Aug 18, 2009 - added new script to perform deconvolution on an image in the frequency domain
    • fftconvol: Aug 18, 2009 - added new script to perform convolution on an image in the frequency domain
    • spectrum: Aug 17, 2009 - added new script to compute the spectrum image from the magnitude of the Fourier transform of an image
    • screeneffects: July 15, 2009 - added new script to apply screen-like effects to an image
    • frosted: July 13, 2009 - added new script to apply a frosted glass effect to an image
    • redist: July 3, 2009 - improved speed by factor of 10x
    • histmatch: July 3, 2009 - improved speed by factor of 10x
    • histmatch: June 30, 2009 - fixed bug when images were not the same size
    • histmatch: June 25, 2009 - added new script to modify one image to try to match its histogram (and saturation) to another image
    • bcmatch: June 25, 2009 - added new script to modify one image to try to match its brightness, contrast (and saturation) to another image
    • glasseffects: June 24, 2009 - added new script to modify an image so that it appears to be viewed through textured and/or tiled glass
    • spherize: June 20, 2009 - added new script to warp an image onto a (hemi-)sphere
    • textcleaner: June 9, 2009 - added new script to processs a scanned document of text to clean the text background
    • June 5, 2009 - modified texteffect to allow gradient color specification and separate gradient angle
    • June 3, 2009 - improved speed performance of autowhite
    • exposure: June 1, 2009 - added new script to change the exposure level of an image


Scripts By Category
Geometry Image
Effects
Brightness
Contrast
Blur
Sharpen
Edge
Color Threshold
Segment
Noise
Addition
Removal
Fourier
Transform
Miscellaneous
Utilities
3Dbox Generates a perspective view of a 3D box at any orientation with pictures pasted on each of its sides Generates a perspective view of a 3D box at any orientation with pictures pasted on each of its sides bordereffects Creates various dispersion-like effects in the border of an image Creates various dispersion-like effects in the border of an image autogamma Modifies an image to automatically apply a gamma correction Modifies an image to automatically apply a gamma correction binomial Generates high pass or low pass filtered images based upon convolution kernels whose weights are derived from the binomial coefficients Generates high pass or low pass filtered images based upon convolution kernels whose weights are derived from the binomial coefficients anglegradient Creates a gradient effect at a specific orientation angle Creates a gradient effect at a specific orientation angle 2colorthresh Automatically thresholds an image to binary (b/w) format using an adaptive spatial subdivision color reduction technique Automatically thresholds an image to binary (b/w) format using an adaptive spatial subdivision color reduction technique isonoise Reduces isolated noise in an image Reduces isolated noise in an image camerablur Blurs an image in the frequency domain using an ideal blurring filter for either motion blur or lens defocus Blurs an image in the frequency domain using an ideal blurring filter for either motion blur or lens defocus 3Dtext Converts text into an image with a 3D extrusion effect Converts text into an image with a 3D extrusion effect
3Dreflection Adds a fading reflection below an image and views it in perspective Adds a fading reflection below an image and views it in perspective bordergrid Creates various grid effects in the border of an image Creates various grid effects in the border of an image autolevel Modifies an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction Modifies an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction binomialedge Sharpens (or blurs) an image near edges using a Binomial shaped filter Sharpens (or blurs) an image near edges using a Binomial shaped filter autocolor Automatically color balances an image Automatically color balances an image fuzzythresh Automatically thresholds an image to binary (b/w) format using the fuzzy c-means technique Automatically thresholds an image to binary (b/w) format using the fuzzy c-means technique morphology Performs binary or grayscale morphologic operations on an image, including dilate, erode, open and close Performs binary or grayscale morphologic operations on an image, including dilate, erode, open and close cameradeblur Deblurs an image in the frequency domain using an ideal deblurring filter for either motion blur or lens defocus Deblurs an image in the frequency domain using an ideal deblurring filter for either motion blur or lens defocus adjoin Appends multiple images together with positional justification Appends multiple images together with positional justification
3Drotate Applies a perspective distortion to an image by providing three rotation angles, zoom, offsets, background color, perspective exaggeration and auto zoom/centering Applies a perspective distortion to an image by providing three rotation angles, zoom, offsets, background color, perspective exaggeration and auto zoom/centering bump Applies a hemispherical-like bump distortion to an image Applies a hemispherical-like bump distortion to an image bcimage Changes the brightness, contrast and/or saturation of an image Changes the brightness, contrast and/or saturation of an image derivative Applies a first directional derivative filter to an image Applies a first directional derivative filter to an image autowhite Automatically adjusts the white balance of an image Automatically adjusts the white balance of an image isodatathresh Automatically thresholds an image to binary (b/w) format using the isodata technique Automatically thresholds an image to binary (b/w) format using the isodata technique perlin Creates an image composed of Perlin type noise Creates an image composed of Perlin type noise cepstrum Creates the cepstrum to depict the type, amount and orientation of camera type blurring in an image Creates the cepstrum to depict the type, amount and orientation of camera type blurring in an image autocaption Places text automatically in a specified square size region that has the least color variation Places text automatically in a specified square size region that has the least color variation
aspectpad Pads an image with a color to a specified aspect ratio and orientation Pads an image with a color to a specified aspect ratio and orientation disperse Applies a dispersion effect to an image Applies a dispersion effect to an image bcmatch Modifies one image to try to match its brightness, contrast and optionally saturation to that of another image Modifies one image to try to match its brightness, contrast and optionally saturation to that of another image gaussian Generates high pass or low pass filtered images based upon a Gaussian shaped convolution. Generates high pass or low pass filtered images based upon a Gaussian shaped convolution. colorconverter To convert any valid ImageMagick color specification to the other ImageMagick color representations To convert any valid ImageMagick color specification to the other ImageMagick color representations kapurthresh Automatically thresholds an image to binary (b/w) format using Kapur's entropy technique Automatically thresholds an image to binary (b/w) format using Kapur's entropy technique statsfilt Computes various localized (neighborhood) statistical filters on an image Computes various localized (neighborhood) statistical filters on an image fftconvol Performs convolution on an image in the frequency domain Performs convolution on an image in the frequency domain autolabel Places text automatically in a specified size region that best matches a reference color Places text automatically in a specified size region that best matches a reference color
aspect Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change frosted Applies a frosted glass effect to an image Applies a frosted glass effect to an image clip Stretches the channels of an image to full black and white according to a clip amount on each end of the histogram Stretches the channels of an image to full black and white according to a clip amount on each end of the histogram gaussianedge Sharpens (or blurs) an image near edges using a Gaussian shaped filter Sharpens (or blurs) an image near edges using a Gaussian shaped filter colorspectrum Generates a spectrum-like image from the colors in an image Generates a spectrum-like image from the colors in an image kmeansthresh Automatically thresholds an image to binary (b/w) format using the k-means technique Automatically thresholds an image to binary (b/w) format using the k-means technique   fftdeconvol Performs deconvolution on an image in the frequency domain Performs deconvolution on an image in the frequency domain bumptext Applies a raised text effect onto an image Applies a raised text effect onto an image
autotrim Automatically trims the background border around a normally oriented or rotated image Automatically trims the background border around a normally oriented or rotated image fxtransitions Creates an animated transition between two images using a special effect distortion Creates an animated transition between two images using a special effect distortion curves Generate a smoothly interpolated, curved mapping look up table from a set of break points and applies it to an image Generate a smoothly interpolated, curved mapping look up table from a set of break points and applies it to an image gradient Applies a gradient filter to an image. Applies a gradient filter to an image. colortemp Transforms an image's overall color balance according to a desired color temperature change Transforms an image's overall color balance according to a desired color temperature change localthresh Automatically thresholds an image to binary (b/w) format using a moving window adaptive thresholding approach Automatically thresholds an image to binary (b/w) format using a moving window adaptive thresholding approach   fftfilter Performs filtering on an image in the frequency domain Performs filtering on an image in the frequency domain captcha Creates a six-alphanumeric-character image for use as a challenge response test Creates a six-alphanumeric-character image for use as a challenge response test
bilinearwarp Generates a proper four-point bilinear warp of the input image Generates a proper four-point bilinear warp of the input image glasseffects Modifies an image so that it appears to be viewed through textured and/or tiled glass Modifies an image so that it appears to be viewed through textured and/or tiled glass exposure Changes the exposure level of an image Changes the exposure level of an image laplacian Applies a laplacian filter to an image Applies a laplacian filter to an image levelcolors Applies a color level transformation to an image channel-by-channel Applies a color level transformation to an image channel-by-channel otsuthresh Automatically thresholds an image to binary (b/w) format using Otsu's between class variance technique Automatically thresholds an image to binary (b/w) format using Otsu's between class variance technique   normcrosscorr Computes the normalized cross correlation surface to find where a small image best matches within a larger image Computes the normalized cross correlation surface to find where a small image best matches within a larger image feather Feathers (smoothes) the white-to-black transition in a binary mask image Feathers (smoothes) the white-to-black transition in a binary mask image
bubblewarp Applies or reverses a warp of an image onto a bubble Applies or reverses a warp of an image onto a bubble glow Creates a glowing effect in an image Creates a glowing effect in an image histmatch Modifies one image to try to match its histogram and optionally saturation to that of another image Modifies one image to try to match its histogram and optionally saturation to that of another image sharp Adaptively sharpens an image or extract edges Adaptively sharpens an image or extract edges mapcolors Maps or translates one set of colors in an image to another set of colors Maps or translates one set of colors in an image to another set of colors sahoothresh Automatically thresholds an image to binary (b/w) format using Sahoo's entropy technique Automatically thresholds an image to binary (b/w) format using Sahoo's entropy technique   notch Creates and applies a notch filter to an image in the frequency domain to remove dither patterns and other regular noise patterns Creates and applies a notch filter to an image in the frequency domain to remove dither patterns and other regular noise patterns flicker Displays and optionally save an animation of the input images Displays and optionally save an animation of the input images
cylinderize Applies a cylinder distortion to an image so that the image is wrapped about the cylinder Applies a cylinder distortion to an image so that the image is wrapped about the cylinder halo Applies a circular halo to an image Applies a circular halo to an image omnistretch Enhances the dynamic range of brightness values and optionally saturation values in an image Enhances the dynamic range of brightness values and optionally saturation values in an image sharpedge Adaptively sharpens (or blurs) an image near edges Adaptively sharpens (or blurs) an image near edges nearestcolor Finds the nearest color value in an image to a reference color Finds the nearest color value in an image to a reference color separate Identifies each separate white shape in a binary image Identifies each separate white shape in a binary image   spectrum Computes the spectrum image from the magnitude of the Fourier Transform of an image Computes the spectrum image from the magnitude of the Fourier Transform of an image flickerchannel Displays and optionally save an animation of the channels in an image Displays and optionally save an animation of the channels in an image
defisheye Corrects for fisheye distortion in an image Corrects for fisheye distortion in an image imageborder Appends an image border by extending the outer regions of the image Appends an image border by extending the outer regions of the image plm Generates a piece-wise linear mapping grayscale look up table and applies it to an image Generates a piece-wise linear mapping grayscale look up table and applies it to an image variableblur Applies a variable blur to an image based upon a mask image Applies a variable blur to an image based upon a mask image pseudocolor Generates a pseudocolored image or pseudocolored animation from grayscale image using a rainbow colored transformation Generates a pseudocolored image or pseudocolored animation from grayscale image using a rainbow colored transformation textcleaner Processes a scanned document of text to clean the text background Processes a scanned document of text to clean the text background     grid Superimposes a set of horizontal and/or vertical grid lines on an image Superimposes a set of horizontal and/or vertical grid lines on an image
downsize Downsizes (reduces) an image to a specified file size Downsizes (reduces) an image to a specified file size kaleidoscope Applies a kaleidoscope effect to an image Applies a kaleidoscope effect to an image plmlut Generates a piece-wise linear mapping grayscale look up table Generates a piece-wise linear mapping grayscale look up table zoomblur Applies a radial or zoom blur to an image Applies a radial or zoom blur to an image saturation Changes the color saturation in an image Changes the color saturation in an image trianglethresh Automatically thresholds an image to binary (b/w) format using the triangle technique Automatically thresholds an image to binary (b/w) format using the triangle technique     histog Generates an output image which is composed of the histograms from each channel of the input image Generates an output image which is composed of the histograms from each channel of the input image
fisheye Applies a fisheye distortion to an image Applies a fisheye distortion to an image melt Creates a melting-like blur effect in an image Creates a melting-like blur effect in an image redist Modifies an image so that its (grayscale) histogram has a either Gaussian, distribution or a Uniform Distribution Modifies an image so that its (grayscale) histogram has a either Gaussian, distribution or a Uniform Distribution   scatter Generates a channel-by-channel scatter diagram between two images. Generates a channel-by-channel scatter diagram between two images. whiteboard Processes a picture of a whiteboard to clean up the background and correct the perspective Processes a picture of a whiteboard to clean up the background and correct the perspective     magicwand Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate
fisheye2pano Generates a strip panoramic image from a linear type fisheye image with optional vertical perspective correction Generates a strip panoramic image from a linear type fisheye image with optional vertical perspective correction mirrorize Creates a mirror effect in an image Creates a mirror effect in an image retinex Enhances detail and color in an image using the multiscale retinex algorithm Enhances detail and color in an image using the multiscale retinex algorithm   scatterchannels Generates a scatter diagram between channels of an image Generates a scatter diagram between channels of an image       picframe Adds a picture frame around an image Adds a picture frame around an image
fisheye2rect Generates a perspective (rectilinear) image from a region of a vertically viewed fisheye image Generates a perspective (rectilinear) image from a region of a vertically viewed fisheye image mottle Applies various mottle effects to an image Applies various mottle effects to an image space Applies a spatially adaptive contrast (and brightness) enhancement filter to an image Applies a spatially adaptive contrast (and brightness) enhancement filter to an image   slice Thresholds an image (inclusively) between a range of graylevels and optionally colorizes inside and/or outside the threshold range Thresholds an image (inclusively) between a range of graylevels and optionally colorizes inside and/or outside the threshold range       profile Generates a profile of an image row or column Generates a profile of an image row or column
lupe Applies a magnifying glass effect in a local area of an image Applies a magnifying glass effect in a local area of an image pixelize Creates a pixelized or blocky effect in an image Creates a pixelized or blocky effect in an image stretch Modifies an image to automatically stretch the dynamic range between full black and white Modifies an image to automatically stretch the dynamic range between full black and white   tintilize Applies a color tint to the mid-range of a grayscale image Applies a color tint to the mid-range of a grayscale image       similar Computes the normalized cross correlation similarity metric between two equal dimensioned images Computes the normalized cross correlation similarity metric between two equal dimensioned images
multicrop Crops and unrotates multiple images from a scanned image Crops and unrotates multiple images from a scanned image recursion Creates a recursive affine composite effect in an image Creates a recursive affine composite effect in an image     tricolorize Smoothly colorizes a grayscale image with either one, two or three different colors Smoothly colorizes a grayscale image with either one, two or three different colors       spline Draws a spline curve on an image based upon supplied points Draws a spline curve on an image based upon supplied points
pano2rect Applies vertical perspective correction to an angular panoramic image Applies vertical perspective correction to an angular panoramic image ripples Applies various circular ripple effects to an image Applies various circular ripple effects to an image     uwcorrect Corrects the color balance for red light attenuation in pictures taken underwater Corrects the color balance for red light attenuation in pictures taken underwater       splitimage Generates a side-by-side append of two partial images with an option to animate the amount of each image used in the append Generates a side-by-side append of two partial images with an option to animate the amount of each image used in the append
pinbarrel Applies or corrects pincushion and/or barrel lens distortion to an image Applies or corrects pincushion and/or barrel lens distortion to an image screeneffects Applies screen-like effects to an image Applies screen-like effects to an image     whitebalance Transform an image's overall color balance according to a desired change in a specified white point color Transform an image's overall color balance according to a desired change in a specified white point color       stdimage Computes a pixel-by-pixel standard deviation or variance image from multiple input images Computes a pixel-by-pixel standard deviation or variance image from multiple input images
polar Applies either a rectangular (cartesian) to polar transformation or a polar to rectangular (cartesian) transformation on an image Applies either a rectangular (cartesian) to polar transformation or a polar to rectangular (cartesian) transformation on an image starburst Applies a starburst pattern to an image Applies a starburst pattern to an image             texteffect Convert text to an image after applying various effects, styling and color Convert text to an image after applying various effects, styling and color
rotate3D Applies a perspective distortion to an image by providing three rotation angles and an optional perspective exaggeration Applies a perspective distortion to an image by providing three rotation angles and an optional perspective exaggeration striations Applies radial or circular striations to image Applies radial or circular striations to image              
shapemorph Create a shape morphing animation sequence between two images Create a shape morphing animation sequence between two images stutter Creates a 'stuttered' offset-like effect in an image Creates a 'stuttered' offset-like effect in an image              
skew Applies a skew distortion to an image Applies a skew distortion to an image transitions Applies an animated transition between two images Applies an animated transition between two images              
sphere Creates a colored sphere with a combination of diffuse and specular illumination Creates a colored sphere with a combination of diffuse and specular illumination tunnelize Creates a tunnel-like effect on an image Creates a tunnel-like effect on an image              
spherize Warps an image onto a (hemi-)sphere Warps an image onto a (hemi-)sphere                
squareup Resizes an image and squares it up either by padding or cropping Resizes an image and squares it up either by padding or cropping                
unrotate Automatically unrotates a rotated image and trims the surrounding border Automatically unrotates a rotated image and trims the surrounding border                
unrotate Automatically unrotates a rotated image and trims the surrounding border Automatically unrotates a rotated image and trims the surrounding border                


2colorthresh

Automatically thresholds an image to binary (b/w) format using an adaptive spatial subdivision color reduction technique.


last modified: October 29, 2008

original

thresholded

 


3Dbox

Generates a perspective view of a 3D box at any orientation with pictures pasted on each of its sides


last modified: April 16, 2009

example 1

example 2

example 1:
pan=45 degrees
tilt=-45 degrees

example 2:
pan=45 degrees
tilt=-30 degrees



3Dreflection

Adds a fading reflection below an image and views it in perspective.


last modified: February 06, 2010

original

reflected



3Drotate

Applies a perspective distortion to an image by providing rotation angles, zoom and offsets.


last modified: September 29, 2008

original

modified

pan=45 degrees
tilt=45 degrees
zoom=-1.5



3Dtext

Converts text into an image with a 3D extrusion effect.


last modified: January 05, 2009



adjoin

Appends multiple images together with positional justification.


last modified: December 03, 2008

3 center aligned appended images



anglegradient

Creates a gradient effect at a specific orientation angle.


last modified: February 04, 2010

standard gray

red 30 degrees



aspect

Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change.


last modified: May 30, 2008

original

cropped

padded



aspectpad

Pads an image with a color to a specified aspect ratio and orientation.


last modified: December 04, 2009

original (3:2)

aspect (2:1)

aspect (4:3)



autocaption

Places text automatically in a specified square size region that has the least color variation.


last modified: February 03, 2010

original
image

captioned
image

 


autocolor

Automatically color balances an image.


last modified: June 02, 2009

original
image

color
adjusted

 


autogamma

Modifies an image to automatically apply a gamma correction.


last modified: March 13, 2009

original
image

colormode
luminance

colormode
rgb



autolabel

Places text automatically in a specified size region that best matches a reference color.


last modified: December 12, 2009

original
image

label
mode

caption
mode



autolevel

Modifies an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction.


last modified: October 21, 2008

original
image

colormode
luminance

colormode
rgb



autotrim

Automatically trim the background border around a normally oriented or rotated image.


last modified: May 09, 2009

original

trimmed

 


autowhite

Automatically adjusts the white balance of an image.


last modified: June 03, 2009

original

method 1

method 2



bcimage

Changes the brightness, contrast and/or saturation of an image


last modified: August 20, 2008


original


enhanced

mapping graph



bcmatch

Modifies one image to try to match its brightness, contrast and optionally saturation to that of another image


last modified: June 25, 2009

reference
image

dark
image

enhanced
image



bilinearwarp

Generates a proper four-point bilinear warp of the input image.


last modified: November 22, 2008

original

warped

 


binomial

Generates high pass or low pass filtered images using a convolution kernel whose weights are derived from the binomial coefficients.


last modified: March 05, 2010

original
image

high pass
sharpened image

low pass
blurred image



binomialedge

Sharpens (or blurs) an image near edges using a Binomial shaped filter.


last modified: March 05, 2010

original
image

sharpening
near edges

sharpening
everywhere



bordereffects

Creates various dispersion-like effects in the border of an image.


last modified: January 13, 2009

original

example 1

example 2



bordergrid

Creates various grid effects in the border of an image.


last modified: March 31, 2009

original

example 1

example 2



bubblewarp

Applies or reverses a warp of an image onto a bubble.


last modified: May 18, 2009

original
image

polar warp
(arcsin)

rect warp
(arcsin)



bump

Applies a hemispherical-like bump distortion to an image.


last modified: February 11, 2009

original

bump

masked bump



bumptext

Applies a raised text effect onto an image.


last modified: January 07, 2010

original

example 1

example 2



camerablur

Blurs an image in the frequency domain using an ideal blurring filter for either motion blur or lens defocus.


last modified: August 22, 2009

original

motion blur

defocus



cameradeblur

Deblurs an image in the frequency domain using an ideal deblurring filter for either motion blur or lens defocus.


last modified: August 22, 2009

original
motion blurred

deblurred
 

 


captcha

Creates a six-alphanumeric-character image for use as a challenge response test.


last modified: June 26, 2009



cepstrum

Creates the cepstrum to depict the type, amount and orientation of camera type blurring in an image.


last modified: January 25, 2010

defocused
image






cepstrum
image

 


clip

Stretches the channels of an image to full black and white according to a clip amount on each end of the histogram.


last modified: October 17, 2008

original
image

colormode
I

colormode
RGB



colorconverter

To convert any valid ImageMagick color specification to the other ImageMagick color representations.


last modified: October 01, 2009

 


colorspectrum

Generates a spectrum-like image from the colors in an image.


last modified: December 20, 2009

original
image



spectrum
image

 


colortemp

Transforms an image's overall color balance according to a desired color temperature change.


last modified: May 30, 2008

original
image

5000 deg K
 

8000 deg K
 



curves

Generate a smoothly interpolated, curved mapping look up table from a set of break points and applies it to an image


last modified: August 21, 2008


original


modified

mapping graph



cylinderize

Generate a smoothly interpolated, curved mapping look up table from a set of break points and applies it to an image


last modified: September 10, 2009


original


cylinderized


cylinderized



defisheye

Corrects for fisheye distortion in an image.


last modified: August 07, 2008

original
fisheye

corrected
perspective

 


derivative

Applies a first directional derivative filter to an image to extract certain edges.


last modified: March 05, 2010

original
image

45 degree
derivative

225 degree
derivative



disperse

Applies a dispersion effect to an image


last modified: February 11, 2009

original

example 1

example 2



downsize

Downsizes (reduces) an image to a specified file size


last modified: December 24, 2009

 


exposure

Changes the exposure level of an image


last modified: June 01, 2009

original

brighter

darker



feather

Feathers (smoothes) the white-to-black transition in a binary mask image.


last modified: July 29, 2008

binary
mask

feathered
mask

feathered composite



fftconvol

Performs convolution on an image in the frequency domain.


last modified: August 18, 2009

original

motion blur filter

result



fftdeconvol

Performs deconvolution on an image in the frequency domain.


last modified: August 22, 2009

original

motion blur filter

result



fftfilter

Performs filtering on an image in the frequency domain.


last modified: August 18, 2009

original

notch filter

result



fisheye

Applies a fisheye distortion to an image.


last modified: August 07, 2008

original
perspective

linear
fisheye

 


fisheye2pano

Generates a strip panoramic image from a linear type fisheye image with optional vertical perspective correction.


last modified: August 15, 2008

fisheye




panorama



fisheye2rect

Generates a perspective (rectilinear) image from a region of a vertically viewed fisheye image.


last modified: August 10, 2008

fisheye



perspective

 


flicker

Displays and optionally save an animation of the input images.


last modified: May 30, 2008

original
image

sharpened
image

flicker
animation



flickerchannel

Displays and optionally save an animation of the channels in an image.


last modified: May 30, 2008


original
image

rgb
animation

hsl
animation



frosted

Applies a frosted glass effect to an image.


last modified: July 13, 2009

original

frosted

 


fuzzythresh

Automatically thresholds an image to binary (b/w) format using the fuzzy c-means technique.


last modified: November 03, 2008

original

thresholded

 


fxtransitions

Creates an animated transition between two images using a special effect distortion


last modified: June 04, 2008

image 1

image 2

transition



gaussian

Generates high pass or low pass filtered images based upon a Gaussian shaped convolution.


last modified: May 30, 2008

original
image

high pass
sharpened image

low pass
blurred image



gaussianedge

Sharpens (or blurs) an image near edges using a Gaussian shaped filter.


last modified: May 30, 2008

original
image

sharpening
near edges

sharpening
everywhere



glasseffects

Modifies an image so that it appears to be viewed through textured and/or tiled glass.


last modified: June 24, 2009

original
image

displace
grid

overlay
grid



glow

Creates a glowing effect in an image


last modified: May 30, 2008

original

Glow

Soft Glow



gradient

Applies a gradient filter to an image to extract edges.


last modified: June 27, 2008

original
image

gradient
 

gradient
thresholded



grid

Superimposes a set of horizontal and/or vertical grid lines on an image.


last modified: May 30, 2008

original
image

black
grid

white
grid



halo

Applies a circular halo to an image.


last modified: June 23, 2009

original

halo 1

halo 2



histmatch

Modifies one image to try to match its histogram and optionally saturation to that of another image


last modified: December 21, 2009

reference
image

dark
image

enhanced
image



histog

Generates an output image which is composed of the histograms from each channel of the image, with options for labeling and color presentation scheme.


last modified: May 30, 2008

original

histogram

histogram



imageborder

Appends an image border by extending the outer regions of the image.


last modified: April 27, 2009


original

result

 


isodatathresh

Automatically thresholds an image to binary (b/w) format using the isodata technique.


last modified: October 30, 2008

original

thresholded

 


isonoise

Reduces isolated noise in an image.


last modified: May 30, 2008

noisy image

isonoise filtered

 



kaleidoscope

Applies a kaleidoscope effect to an image


last modified: December 09, 2009

original

3 sides; edge

3 sides; mirror



kapurthresh

Automatically thresholds an image to binary (b/w) format using Kapur's entropy technique.


last modified: October 29, 2008

original

thresholded

 


kmeansthresh

Automatically thresholds an image to binary (b/w) format using the k-means technique.


last modified: October 29, 2008

original

thresholded

 


laplacian

Applies a laplacian filter to an image to extract edges or sharpen the image.


last modified: March 05, 2010

original
image

sharpened
image

laplacian



levelcolors

Applies a color level transformation to an image channel-by-channel.


last modified: June 17, 2008

original
image

increased
contrast

negated
image



localthresh

Thresholds an image to binary (b/w) format using a moving window adaptive thresholding approach.


last modified: October 30, 2008

original

thresholded

 


lupe

Applies a magnifying glass effect in a local area of an image.


last modified: August 04, 2008

original
image

circle
lupe

square
lupe



magicwand

Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate.


last modified: August 06, 2008

original
image

color
change

boundary
edge



mapcolors

Maps or translates one set of colors in an image to another set of colors


last modified: March 19, 2009

original

color mapped



melt

Creates a melting-like blur effect in an image


last modified: July 15, 2008

original

South

East



mirrorize

Creates a mirror effect in an image


last modified: May 30, 2008

original

West

NorthEast



morphology

Performs binary or grayscale morphologic operations on an image, including dilate, erode, open and close.


last modified: December 18, 2009

original
image

close
 

open



mottle

Applies various mottle effects to an image.


last modified: February 12, 2009

original
image

displace
 

blend
 



multicrop

Crops and unrotates multiple images from a scanned image.


last modified: January 31, 2010

original
image

left
image

right
image



nearestcolor

Finds the nearest color value in an image to a reference color


last modified: April 02, 2009

original


output
swatches



normcrosscorr

Computes the normalized cross correlation surface to find where a small image best matches within a larger image.


last modified: August 25, 2009





small
image

large
image

correlation
image

match
location



notch

Creates and applies a notch filter to an image in the frequency domain to remove dither patterns and other regular noise patterns.


last modified: January 24, 2010

original
image

filtered
image

mask
image



omnistretch

Enhances the dynamic range of brightness values and optionally saturation values in an image by analyzing and linearly stretching the image's histogram.


last modified: August 20, 2008


original


enhanced

mapping graph



otsuthresh

Automatically thresholds an image to binary (b/w) format using Otsu's between class variance technique.


last modified: October 29, 2008

original

thresholded

 


pano2rect

Applies vertical perspective correction to an angular panoramic image


last modified: August 27, 2008

panorama

tilt perspective correction



perlin

Creates an image composed of Perlin type noise


last modified: August 31, 2009

grayscale noise

color noise

 


picframe

Adds a picture frame around an image


last modified: May 30, 2008



original

framed

 


pinbarrel

Applies or corrects pincushion and/or barrel lens distortion to an image


last modified: January 08, 2010


original


barrel


pincushion



pixelize

Creates a pixelized or blocky effect in an image


last modified: May 30, 2008

original

size 5

size 7



plm

Generates and applies a piece-wise linear mapping look up table to an image


last modified: August 20, 2008


original


modified

mapping graph
(same as plmlut)



plmlut

Generates a piece-wise linear mapping look up table (image)


last modified: August 20, 2008

 


no input


look up table

mapping graph



polar

Applies either a rectangular (cartesian) to polar transformation or a polar to rectangular (cartesian) transformation on an image


last modified: August 14, 2008

original

rect2polar

polar2rect



profile

Generates a profile of an image row or column.


last modified: June 25, 2009

original
image
(128x128)



pseudocolor

Generates a pseudocolored image or pseudocolored animation from a grayscale image using a rainbow colored transformation.


last modified: January 05, 2009

original

pseudocolor

look up table



recursion

Creates a recursive affine composite effect in an image


last modified: January 05, 2009

original

example 1

example 2



redist

Modifies an image so that its (grayscale) histogram has a Gaussian, sometimes called normal or bell-shaped, distribution.

(The best autolevels-like function that I have found so far)


last modified: July 16, 2009

original

enhanced

modified
grayscale histogram



retinex

Enhances detail and color in an image using the multiscale retinex algorithm.


last modified: May 30, 2008

original
image

enhanced
rgb mode

enhanced
hsl mode



ripples

Automatically color balances an image.


last modified: February 11, 2009

original
image

water-like
ripples

 


rotate3D

Applies a perspective distortion to an image by providing rotation angles and automatically scale to the same size as the input image


last modified: May 30, 2008

original

modified

pan=45 degrees
tilt=45 degrees



sahoothresh

Automatically thresholds an image to binary (b/w) format using Sahoo's entropy technique.


last modified: October 29, 2008

original

thresholded

 


saturation

Changes the color saturation in an image.


last modified: December 29, 2008

original
image

increased
saturation

decreased
saturation



scatter

Generates a channel-by-channel scatter diagram between two images.


last modified: December 13, 2008

image 1
 

image 2
 

scatter
diagram



scatterchannels

Generates a scatter diagram between channels of an image.


last modified: December 13, 2008

image
 

scatter
diagram

 


screeneffects

Applies screen-like effects to an image.


last modified: July 15, 2009

original

simple

displace



separate

Identifies each separate white shape in a binary image.


last modified: February 26, 2010

original

mode 2

mode 3



shapemorph

Creates a shape morphing animation sequence between two images.


last modified: September 02, 2008

image 1

image 2

morph



sharp

Adaptively sharpens an image or extract edges.


last modified: June 27, 2008

original
image

sharpening
 

edge
extraction



sharpedge

Adaptively sharpens (or blurs) an image near edges.


last modified: June 27, 2008

original
image

sharpening
near edges

sharpening
everywhere



similar

Computes the normalized cross correlation similarity metric between two equal dimensioned images.


last modified: January 14, 2010

image 1

image 2

ncc metric
0.807486



slice

Thresholds an image (inclusively) between a range of graylevels and optionally colorizes inside and/or outside the threshold range.


last modified: September 23, 2009

original
image

slice
white/black

slice
white/image



skew

Applies a skew distortion to an image.


last modified: December 29, 2008



original
image



horizontal
skew

vertical
skew



space

Applies a spatially adaptive contrast (and brightness) enhancement filter to an image.


last modified: June 27, 2008

original
image

adaptively
enhanced



spectrum

Computes the spectrum image from the magnitude of the Fourier Transform of an image.


last modified: August 17, 2009

original

spectrum



sphere

Creates a colored sphere with a combination of diffuse and specular illumination.


last modified: March 07, 2010

Diffuse
Lighting

Diffuse & Specular
Lighting

 



spherize

Warps an image onto a (hemi-)sphere.


last modified: March 07, 2010

original
image

black
background

image
background



spline

Draws a spline curve on an image based upon supplied points.


last modified: August 25, 2008

kbs

bspline



splitimage

Generates a side-by-side append of two partial images with an option to animate the amount of each image used in the append.


last modified: May 30, 2008

original

pseudocolor

animation



squareup

Resizes an image and squares it up either by padding or cropping.


last modified: May 30, 2008

original

pad

crop



starburst

Applies a starburst pattern to an image


last modified: February 25, 2009

original
 

added
starburst


created
starburst



stdimage

Computes a pixel-by-pixel standard deviation or variance image from multiple input images.


last modified: March 24, 2009

Image 1
 

Image 2
 

Standard
Deviation



statsfilt

Applies various statistical filters primarily to reduce noise in an image.


last modified: September 12, 2009

noisy
image

arithmetic mean
(average)

arithmetic mean
without extremes



stretch

Modifies an image to automatically stretch the dynamic range between full black and white.


last modified: July 28, 2009

original
image

colormode
luminance

colormode
rgb



striations

Applies radial or circular striations to image.


last modified: February 25, 2009

original
image

radial
striations

circular
striations



stutter

Creates a 'stuttered' offset-like effect in an image


last modified: May 30, 2008

original

horizontal

vertical



textcleaner

Processes a scanned document of text to clean the text background.


last modified: December 17, 2009

original

processed



texteffect

Convert text to an image after applying various effects, styling and color.


last modified: June 06, 2009

Bulge Effect



tintilize

Applies a color tint to the mid-range of a grayscale image.


last modified: November 28, 2009

original

grayscale

tinted



transitions

Applies an animated transition between two images.


last modified: June 04, 2008

image 1

image 2

transition



trianglethresh

Automatically thresholds an image to binary (b/w) format using the triangle technique.


last modified: October 29, 2008

original

thresholded

 


tricolorize

Smoothly colorizes a grayscale image with either one, two or three different colors.


last modified: October 15, 2009

original

grayscale

colorized



trimmer

Trims the background from any number of specified sides of an image.


last modified: May 15, 2009

original

east side

east,west sides



tunnelize

Creates a tunnel-like effect on an image


last modified: May 30, 2008

original

mode 1

mode 2



unrotate

Automatically unrotates a rotated image and trims the surrounding border.


last modified: May 09, 2009

rotated
image



unrotated
image

 


uwcorrect

Corrects the color balance for red light attenuation in pictures taken underwater.


last modified: January 14, 2010

original

corrected

 


variableblur

Applies a variable blur to an image based upon a mask image


last modified: June 04, 2008

image

mask

blurred



whitebalance

Transform an image's overall color balance according to a desired change in a specified white point color.


last modified: May 30, 2008

original
image

modified
white point

 


whiteboard

Processes a picture of a whiteboard to clean up the background and correct the perspective.


last modified: June 09, 2009

original
image

enhanced
image



zoomblur

Applies a radial or zoom blur to an image


last modified: June 02, 2008

original

zoom

more zoom



OTHER USEFUL SCRIPTS

Anthony Thyssen's Image Comparison Animation Script

Anthony Thyssen's Image Profile Script

Anthony Thyssen's Image Histogram Script

Anthony Thyssen's Grayscale Transformation Graph Script

Anthony Thyssen's Show Fonts Script

Anthony Thyssen's Picture Frame Edge Script



USEFUL LINKS

ImageMagick Home Page

ImageMagick Installations

ImageMagick Command Options

ImageMagick Reference Index

ImageMagick Usage Examples

ImageMagick String Formats

ImageMagick Test Images

ImageMagick Image Formats

ImageMagick Pseudo-Image Formats

ImageMagick Image Patterns

ImageMagick Color Formats

ImageMagick Color Names

ImageMagick Image Types

ImageMagick Color Spaces

ImageMagick Drawing Primitives

ImageMagick Show_Fonts Script

ImageMagick Scripts

ImageMagick Display Options

Delegates Repository



USEFUL IMAGEMAGICK INFORMATION COMMANDS
(as of IM 6.3.5.7)
convert -list list all functions
convert -list list list all -list options
convert -list channel list of all image -channel options
convert -list command list all commands
convert -list color list of all color names and values
convert -list colorspace list of all -colorspace options
convert -list compose list of all -compose options
convert -list configure list of your IM version information
convert -list decoration list of all text decorations
convert -list filter list of all -filter options
convert -list font list of all supported fonts (on your system)
convert -list format list of all image formats
convert -list gravity list of all -gravity positioning options
convert -list primitive list of all -draw primitive shapes
convert -list style list of all text styles
convert -list threshold list of all dither/halftone options
convert -list type list of all image types
convert -list virtual-pixel list of all -virtual-pixel options


TESTS USING IM

Liquid-Rescale

Sean Burke's Fourier Transform Demo (FFT/IFT)

Perfectly Clear™ Versus Other Advanced Enhancement Techniques

GREYCstoration: Noise Removal, Inpainting and Resizing

Comparison Of Various Automatic Thresholding Techniques