Fred's ImageMagick Scripts


 

 



  • The following (bash) scripts are available free of charge. Detailed information and examples are available for each on separate pages.

  • 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.

  • Licensing - If you redistribute or incorporate any of these scripts into others, please reference my name and this web page: Fred Weinhaus and http://www.fmwconcepts.com/imagemagick/index.html

  • 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.

  • My testing and tutorial of the upcoming IM FFT functions are available for viewing.

  • Comments and bug reports are always welcome. My contact information is fmw at alink.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.

Scripts By Category
Geometry Image
Effects
Brightness
Contrast
Blur
Sharpen
Edge
Color Noise
Removal
Miscellaneous
Utilities
3Drotate Applies a perspective distortion to an image by providing three rotation angles, zoom, offsets, background color, perspective exaggeration and auto zoom/centering disperse Applies a dispersion effect to an image bcimage Changes the brightness, contrast and/or saturation of an image binomial 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. isonoise Reduces isolated noise in an image captcha Creates a six-alphanumeric-character image for use as a challenge response test
aspect Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change fxtransitions Creates an animated transition between two images using a special effect distortion omnistretch Enhances the dynamic range of brightness values and optionally saturation values in an image binomialedge Sharpens (or blurs) an image near edges using a Binomial shaped filter colorspectrum Generates a spectrum-like image from the colors in an image morphology Performs binary or grayscale morphologic operations on an image, including dilate, erode, open and close feather Feathers (smoothes) the white-to-black transition in a binary mask image
autotrim Automatically trims the background border around a normally oriented or rotated image glow Creates a glowing effect in an image plm Generates a piece-wise linear mapping grayscale look up table and applies it to an image derivative Applies a first directional derivative filter to an image colortemp Transforms an image's overall color balance according to a desired color temperature change statsfilt Computes various localized (neighborhood) statistical filters on an image flicker Displays and optionally save an animation of the input images
bubblewarp Applies or reverses a warp of an image onto a bubble kaleidoscope Applies a kaleidoscope effect to an image plmlut Generates a piece-wise linear mapping grayscale look up table gaussian Generates high pass or low pass filtered images based upon a Gaussian shaped convolution. levelcolors Applies a color level transformation to an image channel-by-channel   flickerchannel Displays and optionally save an animation of the channels in an image
defisheye Corrects for fisheye distortion in an image melt 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 gaussianedge Sharpens (or blurs) an image near edges using a Gaussian shaped filter. pseudocolor Generates a pseudocolored image or pseudocolored animation from grayscale image using a rainbow colored transformation   grid Superimposes a set of horizontal and/or vertical grid lines on an image
fisheye Applies a fisheye distortion to an image mirrorize Creates a mirror effect in an image retinex Enhances detail and color in an image using the multiscale retinex algorithm gradient Applies a gradient filter to an image. saturation Changes the color saturation in an image   histog Generates an output image which is composed of the histograms from each channel of the input image
lupe Applies a magnifying glass effect in a local area of an image pixelize Creates a pixelized or blocky effect in an image space Applies a spatially adaptive contrast (and brightness) enhancement filter to an image laplacian Applies a laplacian filter to an image whitebalance Transform an image's overall color balance according to a desired change in a specified white point color   magicwand Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate
pinbarrel Applies or corrects pincushion and/or barrel lens distortion to an image recursion Creates a recursive affine composite effect in an image   sharp Adaptively sharpens an image or extract edges     picframe Adds a picture frame around an image
rotate3D Applies a perspective distortion to an image by providing three rotation angles and an optional perspective exaggeration stutter Creates a 'stuttered' offset-like effect in an image   sharpedge Adaptively sharpens (or blurs) an image near edges     profile Generates a profile of an image row or column
shapemorph Create a shape morphing animation sequence between two images transitions Applies an animated transition between two images   variableblur Applies a variable blur to an image based upon a mask image     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
squareup Resizes an image and squares it up either by padding or cropping tunnelize Creates a tunnel-like effect on an image   zoomblur Applies a radial or zoom blur to an image     texteffect Convert text to an image after applying various effects, styling and color
unrotate Automatically unrotates a rotated image and trims the surrounding border            

3Drotate

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


last modified: May 30, 2008

original

modified

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



anglegradient

Creates a gradient effect at a specific orientation angle.


last modified: May 30, 2008

standard gray

red 30 degrees

red-blue 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



autotrim

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


last modified: May 30, 2008

original

trimmed

 


bcimage

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


last modified: May 30, 2008


original


enhanced

mapping graph



binomial

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


last modified: May 30, 2008

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: May 30, 2008

original
image

sharpening
near edges

sharpening
everywhere



bubblewarp

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


last modified: May 30, 2008

original
image

polar warp
(arcsin)

rect warp
(arcsin)



captcha

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


last modified: June 30, 2008



colorspectrum

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


last modified: May 30, 2008

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
 



defisheye

Corrects for fisheye distortion in an image.


last modified: May 30, 2008

original
fisheye

corrected
perspective

 


derivative

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


last modified: May 30, 2008

original
image

45 degree
derivative

225 degree
derivative



disperse

Applies a dispersion effect to an image


last modified: May 30, 2008

original

example 1

example 2



feather

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


last modified: May 30, 2008

binary
mask

feathered
mask

feathered composite



fisheye

Applies a fisheye distortion to an image.


last modified: May 30, 2008

original
perspective

linear
fisheye

 


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



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



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



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



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: May 30, 2008

original

3 sides; edge

3 sides; mirror



laplacian

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


last modified: May 30, 2008

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



lupe

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


last modified: May 30, 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: May 30, 2008

original
image

color
change

boundary
edge



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: May 30, 2008

original
image

close
 

open



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: May 30, 2008


original


enhanced

mapping graph



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: May 30, 2008


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: July 20, 2008


original


modified

mapping graph
(same as plmlut)



plmlut

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


last modified: July 20, 2008

 


no input


look up table

mapping graph



profile

Generates a profile of an image row or column.


last modified: May 30, 2008

original
image
(128x128)



pseudocolor

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


last modified: May 30, 2008

original

pseudocolor

look up table



recursion

Creates a recursive affine composite effect in an image


last modified: May 30, 2008

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: May 30, 2008

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



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



saturation

Changes the color saturation in an image.


last modified: May 30, 2008

original
image

increased
saturation

decreased
saturation



shapemorph

Creates a shape morphing animation sequence between two images.


last modified: July 11, 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



space

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


last modified: June 27, 2008

original
image

adaptively
enhanced



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



statsfilt

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


last modified: June 27, 2008

noisy
image

arithmetic mean
(average)

arithmetic mean
without extremes



stutter

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


last modified: May 30, 2008

original

horizontal

vertical



texteffect

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


last modified: May 30, 2008

Bulge Effect



transitions

Applies an animated transition between two images


last modified: June 04, 2008

image 1

image 2

transition



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 30, 2008

rotated
image



unrotated
image

 


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

 


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 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



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 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

Fourier Transforms (FFT/IFT)

Perfectly Clear™ Versus Other Advanced Enhancement Techniques

GREYCstoration: Noise Removal, Inpainting and Resizing