Modify Color Palette

Quantize Color icon {width="200px"}

In: Filters > Adjustments

Description

Modifies the colors in an ordered palette and applies it to an image using an ID map.

Colors can be selected by matching the indexes in the ID map to the indexes of colors in the palette.

For instance, color #2 in the palette will be applied to all pixels in the ID map with an ID value of 2.

This node may be used in combination with the following nodes: Quantize Color, Create Color Palette, Apply Color Palette, View Color Palette.

Output connectors

Parameters

Input connectors

ID Grayscale PRIMARY
The input ID map used to select colors, in order to modify and distribute them in the output.   An ID map is an image where pixels which are part of a whole (E.g., a shape) all hold the same unique identification value. In this case, the value is an integer.   An ID map can be produced using a Quantize Color node.
Palette Color
An ordered list of RGB colors encoded as a row of pixels. The palette can hold a maximum of 256 colors. This is the palette that the node modifies.   Palettes may be produced with the Quantize Color or Create Color Palette nodes.

Output connectors

Output Color
The result of mapping the colors in the modified palette to the indexes of the ID map.
Palette Color
The updated palette with the specified color modifications applied.   The palette may be applied to another image with the Apply Color Palette node, or visualized with the View Color Palette node.

Parameters

Color selection mode Integer

The method of selecting the target color in the palette which should be modified:

  • Color index: The index of the target color
  • Image space: The position in the ID map where the index should be sampled. When this mode is selected, a position gizmo is available in the 2D View for easy selection
Color position Float2   Available when ‘Color selection mode’ is set to ‘Image space’
The position in the ID map where the index should be sampled.   Use the gizmo in the 2D View for easily selecting a location in the image.   Tip: You may display the quantized image that the ID map is extracted from, then select the Modify Color Palette node to display the gizmo. This makes selecting a color to modify more intuitive.
Color index Integer   Available when ‘Color selection mode’ is set to ‘Color index’
The index of the target color.   Colors in the palette are ordered from left to right, and the first color’s index is 0.
Color selection spread Float
Controls how far the selection reaches into neighbouring colors.   Colors are arranged in a  cube  which width, height and depth are a gradient where each component of a color increases from 0 to 1 (E.g. red, green and blue in RGB).   This parameter adjusts how far around the selected color in the cube other colors can also be modified, where 1 is the full cube’s width.
Color selection contrast Float
Controls the falloff gradient of the selection over neighbouring colors.   Colors are arranged in a  cube  which width, height and depth are a gradient where a component of a color increases from 0 to 1 (E.g. red, green and blue in RGB).   This parameter adjusts the selection falloff over other colors in the cube around the selected color, where 0 is a smooth gradient from the selected color to the farthest and 1 is a cutoff from fully included to not included.
Distance color space Integer

Colors are arranged in a  cube  which width, height and depth are a gradient where a component of a color increases from 0 to 1 (E.g. red, green and blue in RGB). This parameter lets you select the color space used to distribute colors in the cube, which changes neighbouring colors.   You may select the color space which fits your use case:

  • Lab (Color): A standardized perceptual color space, which distributes colors in such a way that colors that ‘feel’ close are actually close in the cube. This is appropriate for images which may be visualized on displays.
  • RGB (Data): Color is split into Red, Green and Blue and distributed straight along those axis, disregarding human perception. This is appropriate for images holding raw data, such as normal maps.
Mode Integer

The method of modifying the target color:

  • Override color: replace the color with another one
  • HSL: adjust the color using hue, saturation and lightness offsets
Opacity Float
Controls the interpolation between the original and modified colors, where 1 means the modified color fully replaces the original color.
Override color Float3   Available when ‘Mode’ is set to ‘Override color’
Specifies the color which should replace the original color.
HSL Float3   Available when ‘Mode’ is set to ‘HSL’
Controls the hue, saturation and lightness offsets applied to the original color.

Examples

Modify color palette: Example 1 {modal="regular"}

Modify color palette: Example 2 {modal="regular"}

modify_color_example_2_before
Before
modify_color_example_2_after
After
recommendation-more-help
substance-3d-designer-help-guide