Studio Yotsuba
Back to Node List

Gradient

gradient_generate

Generates a linear or radial gradient image

Reviewed
Guide available

Input Ports

NameTypeDescription
Color A
color_a
Color
Optional override for the start color
Color B
color_b
Color
Optional override for the end color

Output Ports

NameTypeDescription
Image
output
Image
Generated gradient image

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
Linear—

Gradient shape to generate

  • LinearLinear
    Blend the two colors along a straight direction
  • RadialRadial
    Blend the two colors outward from a center point
Width
width
Int
641–1024

Canvas width in pixels

Height
height
Int
641–1024

Canvas height in pixels

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

Start color of the gradient

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

End color of the gradient

Angle
angle
Angle
0— / step 1

Direction angle in image pixel space used for linear gradients

Center X
center_x
Float
0.50–1 / step 0.01

Horizontal center for radial gradients (0.0-1.0)

Center Y
center_y
Float
0.50–1 / step 0.01

Vertical center for radial gradients (0.0-1.0)

Radius
radius
Float
10.01–2 / step 0.01

Radial size where 1.0 means half of the shorter canvas side

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

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