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
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
画像
input
Image
Required
明るさの元にする画像です
パレット
palette
Palette
任意の色ランプです。パレットの並び順を暗い側→明るい側として使います。未接続なら色A・色Bの2色を使います

Output Ports

NameTypeDescription
画像
output
Image
塗り直した画像です

Parameters

NameTypeDefaultRangeDescription / Options
判定基準
source
Enum
OKLCH-L

各ピクセルのどの値をランプ位置として使うかです

  • OKLCH 明度OKLCH-L
    見た目の明るさで判定します。影やハイライトなど、目で見た明暗に合わせたい時に使います。
  • OKLCH 彩度OKLCH-C
    色の鮮やかさで判定します。くすんだ色と鮮やかな色を分けたい時に使います。
  • HSV 彩度HSV-S
    HSV の鮮やかさで判定します。一般的な色相・彩度・明度の感覚で選びたい時に使います。
  • HSV 明度HSV-V
    RGB の一番明るいチャンネルを基準にします。光った色や原色の強さを見たい時に使います。
  • RGB 赤RGB-R
    赤の強さで判定します。赤みだけを抜き出したい時に使います。
  • RGB 緑RGB-G
    緑の強さで判定します。緑成分だけを抜き出したい時に使います。
  • RGB 青RGB-B
    青の強さで判定します。青成分だけを抜き出したい時に使います。
  • アルファAlpha
    透明度で判定します。不透明な形だけをマスクにしたい時に使います。
  • 輝度Luminance
    RGB から計算した明るさで判定します。OKLCH より単純な白黒変換に近い結果が欲しい時に使います。
塗り方
mode
Enum
Steps

ランプから色をどう選ぶかです

  • 段階Steps
    各ピクセルをランプの1色に割り当てます。ドット絵向けのくっきりした段になります
  • 滑らかSmooth
    隣り合うランプ色の間を補間して滑らかに塗ります
色A
color_a
Color
[0,0,0,1]

パレット未接続時に、暗い側で使う色です

色B
color_b
Color
[1,1,1,1]

パレット未接続時に、明るい側で使う色です

段数
steps
Int
42–64

パレット未接続かつ段階モードのとき、2色を何段に分けるかです

反転
invert
Bool
false

ランプの暗い側と明るい側を入れ替えます

元の透明度を保つ
preserve_alpha
Bool
true

オンでは透明度があるピクセルの元アルファを保ち、オフではランプ色のアルファを使います。完全に透明なピクセルは設定にかかわらず変更しません

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
Gradient Map — PixPipeline Node Reference