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. Do not right click to select "download" from the popup menu. 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 pixelize Creates a pixelized or blocky effect in 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 colorspectrum Generates a spectrum-like image from the colors in an image isonoise Reduces isolated noise in an image feather Feathers (smoothes) the white-to-black transition in a binary mask image
aspect Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change stutter Creates a 'stuttered' offset-like effect in an image 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 colortemp Transforms an image's overall color balance according to a desired color temperature change morphology Performs binary or grayscale morphologic operations on an image, including dilate, erode, open and close flicker Displays and optionally save an animation of the input images
autotrim Automatically trims the background border around a normally oriented or rotated image tunnelize Creates a tunnel-like effect on 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 pseudocolor Generates a pseudocolored image or pseudocolored animation from grayscale image using a rainbow colored transformation statsfilt Computes various localized (neighborhood) statistical filters on an image flickerchannel Displays and optionally save an animation of the channels in an image
bubblewarp Applies or reverses a warp of an image onto a bubble   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. saturation Changes the color saturation in an image   grid Superimposes a set of horizontal and/or vertical grid lines on an image
defisheye Corrects for fisheye distortion 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. whitebalance Transform an image's overall color balance according to a desired change in a specified white point color   histog 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   retinex Enhances detail and color in an image using the multiscale retinex algorithm gradient Applies a gradient filter to an image.     magicwand Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate
lupe Applies a magnifying glass effect in a local area of an image   space Applies a spatially adaptive contrast (and brightness) enhancement filter to an image laplacian Applies a laplacian filter to an image     picframe Adds a picture frame around an image
pinbarrel Applies or corrects pincushion and/or barrel lens distortion to an image     sharp Adaptively sharpens an image or extract edges     profile Generates a profile of an image row or column
rotate3D Applies a perspective distortion to an image by providing three rotation angles and an optional perspective exaggeration     sharpedge Adaptively sharpens (or blurs) an image near edges     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           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
unrotate Automatically unrotates a rotated image and trims the surrounding border           texteffect Convert text to an image after applying various effects, styling and color

3Drotate

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


last modified: April 12, 2008

original

modified

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



aspect

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


last modified: February 18, 2008

original

cropped

padded



autotrim

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


last modified: February 02, 2008

original

trimmed

 


bcimage

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


last modified: October 25, 2007


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: October 25, 2007

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

original
image

sharpening
near edges

sharpening
everywhere



bubblewarp

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


last modified: April 14, 2008

original
image

polar warp
(arcsin)

rect warp
(arcsin)



colorspectrum

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


last modified: April 26, 2008

original
image



spectrum
image

 


colortemp

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


last modified: January 21, 2008

original
image

5000 deg K
 

8000 deg K
 



defisheye

Corrects for fisheye distortion in an image.


last modified: April 14, 2008

original
fisheye

corrected
perspective

 


derivative

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


last modified: October 25, 2007

original
image

45 degree
derivative

225 degree
derivative



feather

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


last modified: November 09, 2007

binary
mask

feathered
mask

feathered composite



fisheye

Applies a fisheye distortion to an image.


last modified: April 14, 2008

original
perspective

linear
fisheye

 


flicker

Displays and optionally save an animation of the input images.


last modified: January 21, 2008

original
image

sharpened
image

flicker
animation



flickerchannel

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


last modified: January 29, 2008


original
image

rgb
animation

hsl
animation



gaussian

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


last modified: March 15, 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 03, 2008

original
image

sharpening
near edges

sharpening
everywhere



gradient

Applies a gradient filter to an image to extract edges.


last modified: October 25, 2007

original
image

gradient
 

gradient
thresholded



grid

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


last modified: January 01, 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 02, 2008

original

histogram

histogram



isonoise

Reduces isolated noise in an image.


last modified: October 25, 2007

noisy image

isonoise filtered

 



laplacian

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


last modified: October 25, 2007

original
image

sharpened
image

laplacian



lupe

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


last modified: April 14, 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: January 03, 2008

original
image

color
change

boundary
edge



morphology

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


last modified: April 26, 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: April 03, 2008


original


enhanced

mapping graph



picframe

Adds a picture frame around an image


last modified: March 12, 2008



original

framed

 


pinbarrel

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


last modified: April 14, 2008


original


barrel


pincushion



pixelize

Creates a pixelized or blocky effect in an image


last modified: May 08, 2008

original

size 5

size 7



plm

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


last modified: January 22, 2008


original


modified

mapping graph
(same as plmlut)



plmlut

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


last modified: January 22, 2008

 


no input


look up table

mapping graph



profile

Generates a profile of an image row or column.


last modified: May 02, 2008

original
image
(128x128)



pseudocolor

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


last modified: January 21, 2008

original

pseudocolor

look up table



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: November 20, 2007

original

enhanced

modified
grayscale histogram



retinex

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


last modified: January 29, 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: April 12, 2008

original

modified

pan=45 degrees
tilt=45 degrees



saturation

Changes the color saturation in an image.


last modified: October 25, 2007

original
image

increased
saturation

decreased
saturation



sharp

Adaptively sharpens an image or extract edges.


last modified: April 03, 2008

original
image

sharpening
 

edge
extraction



sharpedge

Adaptively sharpens (or blurs) an image near edges.


last modified: May 03, 2008

original
image

sharpening
near edges

sharpening
everywhere



space

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


last modified: April 03, 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: January 21, 2008

original

pseudocolor

animation



squareup

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


last modified: January 22, 2008

original

pad

crop



statsfilt

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


last modified: November 21, 2007

noisy
image

arithmetic mean
(average)

arithmetic mean
without extremes



stutter

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


last modified: May 08, 2008

original

horizontal

vertical



texteffect

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


last modified: April 14, 2008

Bulge Effect



tunnelize

Creates a tunnel-like effect on an image


last modified: May 08, 2008

original

mode 1

mode 2



unrotate

Automatically unrotates a rotated image and trims the surrounding border.


last modified: February 02, 2008

rotated
image



unrotated
image

 


whitebalance

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


last modified: April 26, 2008

original
image

modified
white point

 


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