Studio Yotsuba
Back to Node List

Gradient Map

gradient_map

Recolors an image by mapping brightness to a palette ramp or a two-color gradient

Reviewed
Guide available

Input Ports

NameTypeDescription
Image
input
Image
Required
Image whose brightness drives the recoloring
Palette
palette
Palette
Optional color ramp. Colors are used in palette order from dark to bright. If omitted, Color A and Color B are used

Output Ports

NameTypeDescription
Image
output
Image
Recolored image

Parameters

NameTypeDefaultRangeDescription / Options
Source
source
Enum
OKLCH-L—

Which value of each pixel drives the ramp

  • OKLCH-LOKLCH-L
    Use perceived brightness. Good when you want the result to match how bright it looks.
  • OKLCH-COKLCH-C
    Use how colorful the pixel is.
  • HSV-SHSV-S
    Use HSV saturation.
  • HSV-VHSV-V
    Use HSV value.
  • RGB-RRGB-R
    Use the red channel.
  • RGB-GRGB-G
    Use the green channel.
  • RGB-BRGB-B
    Use the blue channel.
  • AlphaAlpha
    Use alpha.
  • LuminanceLuminance
    Use Rec.709 RGB luminance.
Mode
mode
Enum
Steps—

How to pick colors from the ramp

  • StepsSteps
    Assign each pixel to the nearest ramp color — crisp bands for pixel art
  • SmoothSmooth
    Blend between neighboring ramp colors
Color A
color_a
Color
[0,0,0,1]—

Color used for the dark side when no palette is connected

Color B
color_b
Color
[1,1,1,1]—

Color used for the bright side when no palette is connected

Steps
steps
Int
42–64

Number of bands used for the two-color ramp in Steps mode

Invert
invert
Bool
false—

Swap the dark and bright ends of the ramp

Preserve Alpha
preserve_alpha
Bool
true—

Keep source alpha on nontransparent pixels when enabled; otherwise use ramp alpha. Fully transparent pixels always remain unchanged

Color Interpolation
interpolation_space
Enum
Current—

Use Current to preserve existing projects; choose OKLCH for skies, fire, magic, and other hue-rich ramps.

  • CurrentCurrent
    Keep this node's previous color blending exactly
  • OklchOklch
    Blend perceived brightness and colorfulness while allowing a chosen hue route
Hue Route
hue_path
Enum
Shortest—

Choose which colors the ramp travels through. Try the two directed routes when the midpoint has the wrong mood.

  • ShortestShortest
    Take the shorter route around the hue wheel
  • ClockwiseClockwise
    Increase hue around the wheel, wrapping through 360 degrees when needed
  • CounterClockwiseCounterClockwise
    Decrease hue around the wheel, wrapping through zero degrees when needed

Overview

Colors a grayscale image such as noise or a height map from dark to light using colors from a palette. The two-node chain ノイズ → グラデーションマップ creates a palette-managed base for a pixel-art texture.

Usage tips

  • For pixel art, start with mode = Steps. The number of steps matches the number of palette colors and produces crisp color regions. Smooth is better for non-pixel-art uses such as gradient wallpaper.
  • The go-to shading workflow is to create only light and dark values in grayscale, then apply a 3–5-color ramp here. Separating shape/shading from color lets you batch-produce color variants by swapping only the palette.
  • When unsure about source, keep the default OKLCH-L, which follows perceived brightness. Alpha is useful for coloring masks.
  • Connect palette_create or common_palette_ref to the palette input to participate in project-wide color management.

Common pitfalls

  • Only two colors appear: with no palette connected, the node uses the two-color Color A/Color B mode. Check the palette input connection.
  • Dark and light colors are reversed: palette order is dark → light. Reorder it or turn invert ON.
  • Semi-transparent areas change opacity: preserve_alpha (ON by default) keeps source alpha. When it is OFF, pixels whose source alpha is greater than zero use the ramp color's alpha. Fully transparent pixels remain untouched either way.

Technical details

  • The source value (0–1) of each pixel selects a position on the ramp.
  • Steps: divides the ramp into equal-width steps and uses the color of the matching step unchanged, producing crisp color regions.
  • Smooth: linearly interpolates between adjacent ramp colors.
  • Fully transparent pixels remain unchanged and uncolored regardless of preserve_alpha.
  • With preserve_alpha ON, nontransparent pixels keep source alpha. With it OFF, those pixels use the selected ramp color's alpha.
  • When a palette is connected, a swatch grid appears in the inspector.

Examples

  1. Color noise: connect a grass palette to Noise(Perlin) → Gradient Map, then color with Steps to create a tile base.
  2. Apply a shading ramp: color a height map from Height From Image with a 3–4-color character skin ramp.
  3. Two-color gradient: leave the palette unconnected, set Color A to navy and Color B to light blue, and use steps=4 for a stepped sky background.
  4. Color an inverted mask: use invert with a mask from Threshold to reverse its dark and light values before coloring.

Related nodes

  • noise_generate — the go-to upstream source for grayscale patterns
  • palette_create — build the ramp palette in the graph
  • palette_quantize — use this to move an existing color image toward a palette by nearest-color search
  • tone_curve — adjust the value distribution before coloring to balance step areas
Back to Node List