To separate an image into its RGB bands in MATLAB, you can use the imread
and imwrite
functions in combination with the splitChannels
function defined below:
main.m401 chars15 lines
Once you have the RGB bands separated, you can modify the blue channel to dye your hair blue using false coloring. Here is an example of how to do this:
main.m502 chars19 lines
The above code loads an image, splits it into its RGB channels, modifies the blue channel to dye your hair blue using false coloring, combines the channels back into an RGB image, displays the resulting image, and saves the image to a file.
gistlibby LogSnag