Yotsuba Games
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
Palette Cycle โ€” PixPipeline Node Reference