Mix color and black and white in the same picture -custom colormaps
This Graphical User Interface(GUI) will essentially allow you to give an antique look to your photos. You basically import a color image and draw as many regions (of any shape) on the image. These regions will retain the original color while the rest of the image will appear black and white. This demo illustrates how to get around the limitation of MATLAB® figures of not allowing two colormaps for the same figure.
You may download the zip file "colormix.zip" and unzip it to a folder on your machine. The files contained are:
1. colormix.m
2. colormix.fig
3. nature32.bmp -> an example input image
You run colormix.m to start the GUI. Click browse and select an image. The image is now shown in grayscale. You may now click "Add ROI" and then create a region of interest on the image. This region will now be in color. You may UNDO as many regions of interests (ROI's) as you want. Once you are satisfied, you may save your work as a JPG file in the current directory. The GUI has been tested in R2007b and R2008a.
Cite As
Vijay Swaminathan (2024). Mix color and black and white in the same picture -custom colormaps (https://www.mathworks.com/matlabcentral/fileexchange/19131-mix-color-and-black-and-white-in-the-same-picture-custom-colormaps), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > Colormaps > Greyscale >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Segmentation and Analysis > Image Segmentation > Color Segmentation >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > ROI-Based Processing >
- MATLAB > Graphics > Images > Modify Image Colors >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.