M-File Help: icolor View code for icolor

icolor

Colorize a greyscale image

C = icolor(im) is a color image C (HxWx3)where each color plane is equal to im (HxW).

C = icolor(im, color) as above but each output pixel is color (3x1) times the corresponding element of im.

Examples

Create a color image that looks the same as the greyscale image

c = icolor(im);

each set pixel in im is set to [1 1 1] in the output.

Create an rose tinted version of the greyscale image

c = icolor(im, colorname('pink'));

each set pixel in im is set to [0 1 1] in the output.

Notes

See also

imono, colorize, ipixswitch


 

© 1990-2012 Peter Corke.