Colorize

Colorize[m]

generates an image from an integer matrix m, using colors for positive integers and black for non-positive integers.

Colorize[image]

replaces intensity values in image with pseudocolor values.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Colorize a grayscale image:

Colorize a label matrix returned from a segmentation:

Colorize a 3D label matrix:

Options  (7)

ColorFunction  (3)

Apply a color scheme to a map:

Colorize a grayscale image:

Keep the background black using ColorRules:

Use a pure function as the color function:

ColorRules  (3)

Specify a background color different than black:

Specify color replacement rules for all matrix values:

Specify a color for the largest component:

ImageSize  (1)

By default, ImageSize->Automatic is used:

Specify the image size:

Applications  (3)

Pseudocoloring of an elevation map:

Random coloring of a map:

Colorize segmented countries based on their area:

Possible Issues  (1)

All foreground pixels are colored the same in a binary image:

To highlight components using different colors, compute the connected components first:

Neat Examples  (2)

Random colors applied to connected components of a cellular automaton:

Running more steps of the cellular automaton:

Colorize components in a 3D cellular automaton:

Wolfram Research (2010), Colorize, Wolfram Language function, https://reference.wolfram.com/language/ref/Colorize.html (updated 2012).

Text

Wolfram Research (2010), Colorize, Wolfram Language function, https://reference.wolfram.com/language/ref/Colorize.html (updated 2012).

BibTeX

@misc{reference.wolfram_2020_colorize, author="Wolfram Research", title="{Colorize}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/Colorize.html}", note=[Accessed: 10-May-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_colorize, organization={Wolfram Research}, title={Colorize}, year={2012}, url={https://reference.wolfram.com/language/ref/Colorize.html}, note=[Accessed: 10-May-2021 ]}

CMS

Wolfram Language. 2010. "Colorize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/Colorize.html.

APA

Wolfram Language. (2010). Colorize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Colorize.html