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
- Colorize generates a pseudo or false coloring of 2D and 3D images to better visualize details in an image. It can also colorize an integer array, typically generated from a segmentation and clustering.
- Colorize works with 2D and 3D images and integer arrays.
- Colorize generates an 8-bit RGB image.
- Colorize takes the following options:
-
ColorFunction Automatic how each pixel should be colored ColorFunctionScaling True whether to scale the argument to ColorFunction ColorRules Automatic rules for determining colors from matrix and pixel values ImageSize Automatic the default displayed size of the image - By default, for images, "DarkRainbow" is used. Intensity values below 0 and above 1 are clipped.
- For integer arrays, 0s and negative integer values are shown in black. Positive integers are colored using distinct colors for consecutive integers.
- Use ColorFunctionfunc to specify a different color function. The function func maps scaled values between 0 and 1 to color values.
- Use ColorFunctionScalingFalse to specify a color function on unscaled input values.
- Supported ColorFunction settings include:
-
GrayLevel apply gray-level color space Hue apply HSB color space ColorData["scheme"] apply the specified ColorData function "scheme" equivalent to ColorData["scheme"] "GrayLevelOpacity" apply GrayLevel with Opacity; black values near 0 will be transparent, while white shades near 1 will be opaque "HueOpacity" apply Hue with Opacity "schemeOpacity" apply ColorData["scheme"] with Opacity "XRay" approximate an x-ray effect "WhiteBlackOpacity" apply a white-to-black color component with opacity - Use ColorRules to specify a list of color replacements. For arrays, color rules substitute integer values. For images, color rules are applied to grayscale values.
- Colorize generates an RGB image of type "Byte". The image may have an alpha channel, depending on the input image, color function and color rules.
Examples
open allclose allBasic Examples (2)
Scope (5)
Options (10)
ColorFunction (4)
Apply a color scheme to a map:
Keep the background black using ColorRules:
Use a pure function as the color function:
A color function with opacity returns an image with an -channel:
ColorRules (5)
Applications (5)
Properties & Relations (1)
Colorize a grayscale image using a neural network from the Wolfram Neural Net Repository:
Possible Issues (1)
Text
Wolfram Research (2010), Colorize, Wolfram Language function, https://reference.wolfram.com/language/ref/Colorize.html (updated 2012).
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