File Exchange

image thumbnail

Image Manipulation Toolbox

version 1.41 (16.3 MB) by DGM
A large collection of image manipulation tools of varying utility


Updated 21 Apr 2021

View License

This library is a loose collection of image manipulation and degradation functions I developed as part of a meandering set of 'artistic' hobbies. While I have tried to extend several of the functions toward a more general utility in image editing or analysis, understand that none of these functions began life with that intention. I post these tools only on the basic assumption that if they have been useful to me, then surely they'll be useful in part to someone else.

This was written and tested in R2009b and R2015b, with cursory testing in R2012a and R2019b.

Only a few files use IP Toolbox (see DEPENDENCIES.txt)
Let me know if you find bugs (msg me from my profile).

GUI extensions of several core functions
Passthrough/fallback replacements for several IPT tools
Multi-model color picker GUI
GUI for parametric color-based mask generation
Image viewer with support for alpha and 4D image browsing
Image blending, compositing and masking tools
Color adjustment in various color models
Contrast or chroma enhancement via levels/curves tool (RGB or LAB)
Bidirectional colorspace conversion tools (HSL, HSI, HSY, HSYp, HuSL, HuSLp, LCHab, LCHuv, SRLAB2, OKLAB, YCH)
Animated GIF import/export tools
4D image array support on many functions
GIMP compatibility in several tool modes

Documentation with commentary and examples is available at the link above.

colorpicker  --pick color(s) from an image
cpicktool  --interactive color picker GUI
csview  --visualize the projection of sRGB in other spaces
imcompare  --interactively compare two images
imcompose  --compose image from layers as in GIMP or Photoshop
imgenerate  --interactively generate simple images
immask  --interactively generate selections (parametric magic wand, etc)
immodify  --interactively modify an image
imshow2  --image viewer with alpha & 4D support and better view controls

fourdee  --make non-4D functions work on 4D images
imrange  --return global min and max values from any size array
imsize  --fetch array size independent of dimensionality
ismono, issolidcolor, isopaque  --determine image properties
mimread  --import arbitrary selection of files
imhistFB  --calculate image histogram
imstacker  --arrange mismatched images into a 4D array
imstats  --return info about an image
roundodd, roundeven  --round/floor/ceil to nearest odd/even integer
strismember  --faster ismember() for char arrays

colorpict  --easily produce solid color filled image
extractbg  --background estimation for 4D image or video
findpixels  --create a mask of pixels relative to a color
fkgen  --generate atypical filter kernels
lingrad, radgrad  --two-point or multipoint gradients
meanlines  --create a new image from vector means or extrema
mono  --extract a single channel (R,G,B,H,S,V,Y,etc)
multimask  --make mask from a combination of color matches
perlin, perlin3  --create cloudlike noise images or volumes
randlines  --create various fields of random lines and walks
randspots  --create fields of randomly located shapes
rangemask  --make mask from a combination of color matches
xwline  --Xiaolin-Wu antialiased polyline tool

adapthisteqFB  --CLAHE contrast adjustment
addborder  --add a colored border to an image
bwdistFB  --distance transform
bwlabelFB  --connected group labeling
color2alpha  --generate alpha from a selected color
cropborder  --easily crop a border from an image
despeckle  --remove small groups of 1s or 0s
edgemap  --normalized Scharr filter
histeqFB  --image intensity redistribution
imlnc  --contrast enhancement tool (levels, curves, histeq, chroma)
imblend  --blend or composite images
imcast  --flexible typecasting & scaling
imfilterFB  --convolution/correlation filtering
imfold  --repeatedly fan-fold an image into a 4D stack
imhistmatchFB  --adjust image to match another's histogram
imrecolor  --histogram-based color matching between images
imresizeFB  --image resizing
imrotateFB  --image rotation
imtile, imdetile  --rearrange a 4D image into a flat image (or vice-versa)
imtweak  --adjust channels of an image or color
maxchroma  --calculate sRGB gamut extent in other spaces
mergedown  --merge frames of a 4-D image
morphops  --dilation, erosion, opening, closing, tophat, bothat
morphnhood  --uses/replaces bwmorph, bwperim, bwlookup
pseudoblurmap  --multipass variable-kernel blur approximation
replacepixels  --replace pixels with new color or second image
roiflip, roishift  --flip/shift lines in an area specified by a mask
tonemap  --apply a tone map to an image
zblend  --use a mask to create a section of a 4D image

convenience and utility functions
multiframe GIF read/write tools
colorspace conversions
dithers (Zhou-Fang, Bayer, & others)
text-image conversion tools
several nontechnical novelties
(~160 tools in total as of 3/2021)

This archive includes all image conversion/blending tools I've submitted to date

Cite As

DGM (2021). Image Manipulation Toolbox (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!






MIMT/FEX_dependencies/STFT toolbox






MIMT/demo scripts