File Exchange

image thumbnail


version (954 KB) by jiro
Create a flattened image with an overlayed mask, with specified color and opacity (transparency).

1 Download

Updated 01 Sep 2016

View License

This function overlays a logical mask on top of an image (with user-defined color and opacity) and creates a flattened image without an alpha channel. The resulting output can be treated as another image data. Interactive explorations, such as zooming, panning, and data tips, are faster, because the image does not contain an alpha channel.
flattenMaskOverlay(img, mask, opacity, color);

See the published example for more information.

Cite As

jiro (2020). flattenMaskOverlay (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)



Updated license

Fixed alphaLevel bug and example bug.

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

Inspired by: Image overlay, showMaskAsOverlay