Gradient map

Atomic node: Gradient map{width="200px"}

Remaps the grayscale values in an image using a custom gradient.

This node serves a dual purpose: It may be simply used as a grayscale-to-color conversion node, or to colorize grayscale input my mapping it to a custom color ramp.

The node offers an advanced and feature-rich gradient editor to map multiple colors with precision: go to the Gradient editor section in this page to learn more.

Examples

Parameters

Color mode Boolean
Sets the output mode to Color or Grayscale.
Gradient adressing Boolean
Sets the gradient to either repeat (tile) or clamp values that are out of the [0, 1] range.
Gradient Array of gradient keys
The custom gradient ramp used to map the input grayscale values.   May be edited in place or using the Gradient editor.

Gradient editor

This window offers controls to edit the reference gradient used by the Gradient Map node to map grayscale values to colors.

It can be opened from the Gradient Map node’s Properties in the following ways:

  • Click LMB on the  Gradient Editor  button;
  • Double-click LMB on a pin in the gradient bar. The clicked pin will then be automatically selected in the Gradient Editor so you can directly edit its values.

Gradient Editor

Editing the gradient pins

The colors and their positions along the gradient is controlled by pins placed along the gradient bar.

Each pin sets a color at its position along the gradient.

The portions of the gradient before and after the first and last pins are set to those pin’s colors respectively.

Gradient Editor - Gradient view

The following controls are available to edit pins:

Add pin

Click LMB on the gradient or just below to add a pin at the position you clicked in the gradient bar.

The new pin will be set to the gradient’s color at that position.

Gradient Editor - Add pin

Move pin

Hold LMB and drag the selected pins along the gradient bar to move them.

You can also set the position of a pin with a numerical value by selecting it and using the Position parameter. The position is a value in the [0;1] range where 0 is the start of the gradient and 1 is its end.

Gradient Editor - Pin position parameter

Gradient Editor - Move pin

When multiple pins are selected, they can all be moved concurrently. When one or more pins reach and end of the gradient as they are moved, two behaviours are available depending on the mouse button used for moving:

  • LMB: Pins remain at the end, meaning they will be stacked at that location as they reach it and their relative positions are changed;
  • MMB: Pins loop back around to the other end of the gradient, meaning their relative positions remain unchanged.

Delete pin

Select the pins and press Delete, or drag the pins off the gradient bar to delete them.

Gradient Editor - Delete pin

Invert positions

Mirrors the positions of the selected pins on the gradient.

Gradient editor: Invert positions

Clear all

Removes all the pins from the gradient bar.

Gradient Editor - Clear all

Invert colors

This button switches the colors of the selected pins to their negative.

Desaturate

This button desaturates the colors set on the selected pins.

Interpolation modes

Once pins are set up, you can control how colors transition from one pin to the next using the available interpolation modes:

Linear
The default interpolation mode: applies a simple linear interpolation between each pin, so the gradient progresses uniformly.
Flat Tangents

When thinking about the transition between gradients as Bezier curves where pins are points of the curve, this mode sets these points to have horizontal tangents.

This results in a transition that is evocative of a smoothstep interpolation.

When this mode is selected, the Midpoint parameter is enabled and lets you offset the horizontal position of the curve’s vertical midpoint between the points. This effectively tips the scale between the ‘out’ and ‘in’ tangents.

Smooth

Applies smoothing to the interpolation curve between each point.

When this mode is selected, the Smoothness parameter is enabled and lets you adjust the intensity of the smoothing where a value of 0 is equal to the Linear interpolation mode.

No Interpolation

Color only changes at a pins’ location, and stays constant until the next pin along the gradient bar.

This results in hard steps between colors, and only the colors set by the pins are present on the gradient.

color picker

Gradient Editor - Color picker

The Color Picker lets you set a color in several ways:

  • Gradient and hue bar

    table 0-row-2 0-border-0px 1-border-0px 2-border-0px html-authored no-header
    Tweak the positions of the gizmo in the gradient and of the notch in the hue bar to set a color. Color Picker - Gradient area and hue bar
  • RGB, HSV, and Alpha sliders

    table 0-row-2 0-border-0px 1-border-0px 1-width-100.00% 2-border-0px 2-width-33.33% html-authored no-header

    The RGB, HSV and Alpha sliders let you set a color precisely, by tweaking the sliders or directly setting their numerical values.

    Alternatively, use a hexcode in the dedicated input field below the sliders.

    Color Picker - RGB, HSV and Alpha sliders
  • Pick on screen

    table 0-row-2 0-border-0px 1-border-0px 2-border-0px html-authored no-header
    Use the Pick button and click LMB anywhere in the screen to sample the color at that location. Color Picker - Pick on screen
The selected color is previewed in the upper half of the color thumbnail.
The lower half displays the previously used color. Double-click LMB on it to revert the tweaked color to it.
Color Picker - Revert color

When multiple pin are selected, the RGB, HSV and Alpha sliders turn into delta (Δ) sliders, meaning they are used to offset the value of each pin by the same amount.

Additionally, the following capabilities are available below the color thumbnail as buttons:

Invert: Switches the color to its negative;

To Gray: Desaturates the color;

Copy*:* Copy the currently selected color to the clipboard;

Paste: Switch to the color currently in the clipboard;

sRGB: Use the sRGB color space to display colors. When disabled, the Linear color space is used;

Float: Display RGB, HSV and Alpha slider values in floating point.

Color Picker - Buttons

Gradient Eyedropper

The Gradient Eyedropper is one of the most useful features this node offers, as you can create complex gradients just by drawing a line on a reference picture.

Gradient Editor - Gradient Picker

The Precision slider will help you adjust your newly created gradient by increasing or decreasing the number of keys: the lower their values, the more precise your gradient will match your picked values.

Input connectors

Input Grayscale PRIMARY
The grayscale image to be processed.

Output connectors

Output Grayscale

Examples

Coming soon.

recommendation-more-help
dd48abc6-e399-43d2-9777-578ec70c5a23