Back to Node List

Gradient

gradient_generate

Generates a linear or radial gradient image

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
色A
color_a
Color
始点色を外から差し替えます
色B
color_b
Color
終点色を外から差し替えます

Output Ports

NameTypeDescription
画像
output
Image
生成したグラデーション画像です

Parameters

NameTypeDefaultRangeDescription / Options
方式
mode
Enum
Linear

どの形のグラデーションを作るか選びます

  • 線形Linear
    まっすぐな方向に沿って 2 色を補間します
  • 放射Radial
    中心点から外側へ向かって 2 色を補間します
width
Int
641–1024

出来上がる画像の幅です

高さ
height
Int
641–1024

出来上がる画像の高さです

色A
color_a
Color
[0,0,0,1]

グラデーションの始点色です

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

グラデーションの終点色です

角度
angle
Angle
0— / step 1

画像のピクセル座標上で指定する線形グラデーションの向きです

中心X
center_x
Float
0.50–1 / step 0.01

放射グラデーションの横方向中心位置です

中心Y
center_y
Float
0.50–1 / step 0.01

放射グラデーションの縦方向中心位置です

半径
radius
Float
10.01–2 / step 0.01

放射グラデーションの広がりです。1.0 は短辺の半分を表します

色の補間
interpolation_space
Enum
Current

既存プロジェクトの見た目は従来互換で保ちます。空・炎・魔法など色味の変化を整えたい時はOKLCHを選びます。

  • 従来互換Current
    このノードで従来使っていた色の混ぜ方を保ちます
  • 知覚的(OKLCH)Oklch
    見た目の明るさと鮮やかさを補間し、通る色相の方向も選べます
色相の通り道
hue_path
Enum
Shortest

途中でどの色を通るかを選びます。中間色の印象が違う時は時計回り/反時計回りを切り替えます。

  • 近い方Shortest
    色相環の短い側を通ります。通常はこれが自然です
  • 時計回りClockwise
    色相値が増える方向へ進み、必要なら360度をまたぎます
  • 反時計回りCounterClockwise
    色相値が減る方向へ進み、必要なら0度をまたぎます

Overview

Creates a two-color linear or radial gradient image. In addition to serving as a base for skies and backgrounds, it is a fundamental continuous-value map—"top to bottom" or "center outward"—for mask weights, height maps, dither input, and more.

Usage tips

  • For a pixel-art sky, Linear (vertical) → dither (2–4-color palette) is the go-to two-node setup.
  • In black and white, it is a versatile weight map: a soft mask for blend_by_mask, a Multiply asset that darkens toward the bottom, or a radial vignette.
  • A radial gradient with a small radius is a base for a spotlight. center_x/y use relative coordinates from 0 to 1.
  • For a multicolor gradient, create grayscale values here and pass a palette to gradient_map instead. This also makes the color count easier to manage.

Common pitfalls

  • Banding is distracting: the continuous gradient itself is smooth; bands appear after quantizing and may be the right pixel-art result. Use dither when smoothness should be preserved.
  • A diagonal gradient points in an unexpected direction: the fastest solution is to rotate angle while watching its angle knob.

Notes

  • With mode = Linear, the two colors are interpolated along angle in image pixel space, so the specified angle matches the on-screen direction even on a non-square canvas.
  • With mode = Radial, the two colors are interpolated outward from center_x / center_y over radius.
  • radius = 1.0 is based on half the shorter dimension.
  • color_a and color_b can be set as parameters or input ports. Input ports take priority.

Compatibility

  • v2 evaluates Linear angles in pixel space instead of UV space. Diagonal gradients on non-square canvases therefore look different from v1.

Examples

  1. Create a horizontal background gradient.
  2. Use a radial gradient as the base for a mask or coordinate map.
  3. Feed it into Palette Quantize or Dither to create retro color steps.

Related nodes

  • gradient_map — color with a multicolor ramp
  • dither — the companion for a retro sky
  • noise_generate — a nonuniform continuous-value map
  • blend — overlay a light/dark gradient in Multiply mode
Back to Node List
Gradient — PixPipeline Node Reference