Studio Yotsuba
Back to Node List

Palette Cycle

palette_cycle

Rotates palette colors in a loop — the classic technique for animated water, fire, and lava

Reviewed
Guide available

Input Ports

NameTypeDescription
Palette
palette
Palette
Required
Palette to cycle

Output Ports

NameTypeDescription
Palette
palette
Palette
Cycled palette. Connect to Indexed Image Apply Palette for animation

Parameters

NameTypeDefaultRangeDescription / Options
Shift
shift
Float
0-1000000000000–1000000000000 / step 1

How many slots to rotate. Fractions are floored and large values wrap by the selected range, so long-running inputs keep cycling

Range Start
range_start
Int
00–255

First palette slot to cycle

Range Count
range_count
Int
00–256

How many slots to cycle. 0 cycles everything from the start slot

Overview

Cycles the colors in a palette. Without moving a single pixel, it animates water, fire, or waterfalls by rotating only their color assignments—directly reproducing the classic retro-game technique of palette cycling.

Usage tips

  • It works as a three-node set: image_to_indexed_image (assign indices) → Palette Cycle (rotate the palette) → indexed_image_apply_palette (recolor). Cycle does nothing on its own.
  • The go-to setup is to promote shift to an input pin 📌 and connect time_source × frame count. Rotate by exactly the number of colors in the range over one loop for a perfect cycle.
  • Partial cycling with range_start / range_count is the practical key: restrict the animation to a color range such as the four water colors.
  • In the source image, paint the colors to be cycled in gradient order for a clean flow.

Related nodes

  • image_to_indexed_image / indexed_image_apply_palette — required before and after this node
  • time_source — drives shift
  • animation_render — bake the animation
  • palette_get — one-off color lookup (without cycling)

Technical details

  • With shift = 1, every color advances by one slot and the last wraps to the first.
  • The shift wraps automatically by the number of colors in the range (for a four-color range, shift 5 = shift 1).
  • The slider keeps a convenient -256..256 display range, but typed and connected values may continue beyond it. Values such as 257 or 300 still wrap by the selected color count, so a long-running animation does not stop at 256.
  • Slots outside the range are unchanged, allowing partial cycles such as rotating only four water colors while keeping skin colors fixed.

Examples

Water animation (classic palette cycling)

Image → Image to Indexed Image ─→ Indexed Image Apply Palette → completed animation
              └ palette ─→ Palette Cycle ─↑
Time Source → (connect to shift)
  1. Convert the water image to indices with Image to Indexed Image.
  2. Pass its palette output through Palette Cycle, and connect Time Source to shift.
  3. Recolor with Indexed Image Apply Palette → turn it into a sprite sheet with Animation Render.

Partial cycle

If the water colors occupy slots 4–7 of a 16-color palette, use range_start: 4, range_count: 4. Only the water flows while the character colors remain fixed.

Back to Node List