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

Input Ports

NameTypeDescription
パレット
palette
Palette
Required
巡回させるパレットです

Output Ports

NameTypeDescription
パレット
palette
Palette
シフト後のパレットです。「インデックス画像にパレット適用」につなぐとアニメになります

Parameters

NameTypeDefaultRangeDescription / Options
シフト量
shift
Float
0-1000000000000–1000000000000 / step 1

何コマ分ずらすかです。小数は切り捨て、大きな値も選択範囲で巡回するため、長時間入力でも止まりません

範囲の開始
range_start
Int
00–255

巡回させる範囲の最初のスロット番号です

範囲の色数
range_count
Int
00–256

巡回させる色数です。0なら開始スロットから残り全部を巡回します

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