Image Morphology

An interactive environment for morphologically operating on images.
Updated 30 Jun 2020

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

The Image Morphology app is an interactive exploratory environment, with which you can try different morphological operations and structuring elements on your image.
This app supports most morphological operations, including those (like BWHITMISS) that can take multiple STRELS. All STRELS, including arbitrary ones, are now supported. You can easily see the effects of changing the size or shape of your STREL, or of trying different morphological operations. You can also "activate" the modified image to string operations.
The Image Morphology app is a REPLACEMENT FOR MORPHTOOL, which has been shared on the File Exchange since 2007. This version fixes several minor (but long-standing) bugs, and addresses changes needed for R2014b readiness. Image Morphology (as an app, or as function |imageMorphology|) should be more stable and less buggy than previous versions.

Comments/suggestions/collaborations welcome.

Cite As

Brett Shoelson (2024). Image Morphology (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
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!
Version Published Release Notes

Fixes a bug after loading a new image.

Users of MorphTool may want to consider upgrading to ImageMorphology. I addressed many small issues in this version.

Several improvements/updates, including better loading of new images (from file or workspace); default 0-sized strel (this is desirable for large images); and incorporation of new ExpandAxes, which now allows right-click exporting of images!

Added in sound files.

Updated to include an App file for R2012b.

Flattened directory structure to avoid confusion. Replaced deprecated argument-checking functions, and added file-loading functionality when MorphTool is a child of a figure.

Includes a missing subfunction.

Changed the description only.

Including omitted StrelTool file.

Updating screenshot.

Fixed stability/responsiveness issue. Also adds support for a number of different morphological operations.


Fixes an image-import issue.


I think I have fixed issues introduced by changes in R2019b. Please let me know if you find any issues!

V1.3.1.0 addresses a bug in tabPanel introduced by changes in the sharing of variables in subfunction workspaces.

Fixes an error that arose because of changes to core MATLAB's inclusion of subfunctions. Should be fine for R2019b and beyond. (Will work fine in earlier versions, too.)
09/09/2009 Provides missing functions/subfunctions.

A small bug fix in a portion of the generate code, plus better tooltips.

9/5/2009 Re-zipped with missing functions StrelTool and expandAxes.