Palettes
Pick one of the 16 bundled palettes or bring your own, see how Mode 8 maps colors onto it, and make palette swaps of finished art, as files or as a Godot shader.
A game looks like one game when all its art shares one palette. Every Mode 8 command that makes pixels takes --palette: a bundled palette, a palette of your project, or a palette file. Inside a project you set it once, in mode8.toml. When the art is done, mode8 recolor moves it onto another palette, for an enemy variant, a night level or a whole new look.

The bundled palettes#
$ mode8 list palettes
17 palettes
cozy_pastel_rpg 24
cutscene_painterly_48 48
cyberpunk_neon 24
gameboy_dmg 4
isometric_terracotta 24
monochrome_1bit 2
nes_bone_knight 8
nes_cobalt_brick 8
nes_crimson_hero 10
nes_ember_beast 8
nes_flame_prop 8Show 9 more lines
nes_gilded_boss 10
nes_master_gothic 32
nes_midnight_bg 7
pc98_16 16
snes_16bit_overworld 32
vibrant_16 16
Next:
mode8 draft knight_right --palette cozy_pastel_rpg --out hero.pngOn a terminal with color, each name comes with its swatches. They range from 2 colors (monochrome_1bit) and 4 (gameboy_dmg) to 48 (cutscene_painterly_48), and each declares its material ramps (stone, wood, skin, foliage ...) so the procedural art knows which colors shade which material.

Bundled palettes lists every color of every palette.
Use one in a project#
Set the palette when you create the project:
$ mode8 init my-game --default-palette snes_16bit_overworld
✓ Created project my-game/
palette snes_16bit_overworld · new assets 64x72
ComfyUI http://127.0.0.1:8188
Next:
cd my-game
mode8 draft knight_right --out drafts/hero.png
mode8 studio .
mode8 doctor # check the local AI setup for mode8 gen$ cd my-gameFrom then on every command in the project uses it unless you pass --palette, and says so:
$ mode8 draft knight_right --out drafts/hero.png
✓ Drafted knight_right (64x72) → drafts/hero.png
palette snes_16bit_overworld from mode8.toml
Next:
mode8 gen 'armored knight with plumed helm, side view, facing right' --draft drafts/hero.png --out sprites/hero.png # needs ComfyUI
mode8 anim drafts/hero.png --rig humanoid --out-dir frames/hero
mode8 studio .To change it later, edit default_palette in mode8.toml. Art you already made keeps its colors; palette swaps move it.
Your own palette#
--palette also takes a file: a GIMP palette (.gpl), or a list of #rrggbb colors one per line (.hex, the format Lospec exports, or .txt).
For a project, put a .gpl file in its palettes/ folder and use it by name. Ramps are optional comment lines, #ramp <material>: <color numbers>, dark to light, counting the colors from 1:
GIMP Palette
Name: Swamp
#ramp foliage: 1 2 3 4
#ramp water: 5 6 7
#ramp earth: 8 9 10
20 33 28
38 74 51
79 125 64
150 186 92
28 45 72
49 92 120
98 160 170
52 38 33
96 70 50
150 118 80$ mode8 list palettes
18 palettes
swamp 10 project
cozy_pastel_rpg 24
cutscene_painterly_48 48
cyberpunk_neon 24
gameboy_dmg 4
isometric_terracotta 24
monochrome_1bit 2
nes_bone_knight 8
nes_cobalt_brick 8
nes_crimson_hero 10
nes_ember_beast 8Show 10 more lines
nes_flame_prop 8
nes_gilded_boss 10
nes_master_gothic 32
nes_midnight_bg 7
pc98_16 16
snes_16bit_overworld 32
vibrant_16 16
Next:
mode8 draft knight_right --palette swamp --out hero.png$ mode8 tile grass --palette swamp --size 32x32 --out tiles/grass.png
✓ Tile grass (32x32) → tiles/grass.png
top-down · tiles seamlessly in every direction
Next:
mode8 autotile tiles/grass.png --out-dir tiles/grass_set
mode8 lint tiles/grass.png --qualityWithout #ramp lines, Mode 8 groups the colors into ramps by hue itself. Declare them when it guesses wrong, for example when the same green is both your foliage and your slime. mode8 list materials prints the material names the procedural art asks for.
Automatic palettes#
mode8 gen and mode8 pixelize do not need a palette. Without one, they cluster the art's colors into an automatic palette of their own: 16 colors for a sprite, up to 48 for a scene (--colors changes the count). That is often the best way to generate: let the art find its colors, then map it onto your palette as a separate, visible step.
How colors are mapped#
When you give a palette, Mode 8 first clusters the art's colors in OKLab (a color space where equal distances look equally different), then maps each cluster onto the nearest palette color. It reports how much that costs as palette_fit, the average color error, and flags a poor fit:
$ mode8 pixelize ~/Downloads/knight-render.webp --size 64x72 --bg transparent --palette nes_master_gothic --out sprites/knight.png
✓ Pixelized → sprites/knight.png (64x72, 9 colors)
art 204x232 px on a 4.7 px grid, reduced 3.222x
palette fit 0.038 (fair) · background #8a7664 keyed · metric oklab
Next:
mode8 lint sprites/knight.png --qualityA poor fit means the subject needs colors the palette lacks: a crimson cloak on a palette with no deep red. Choose another palette, add the colors, or keep the automatic palette.
- Dither is off by default.
--dither bayer2,bayer4orcheckerdithers smooth gradients only, never flat areas. --metricchooses the color distance:oklab(default) orredmean.- Pure black is not in the bundled palettes, so it stays free for outlines: lint accepts
#000000on the outer outline of any palette.--no-allow-outline-blackrefuses it there too, and--check-interior-blackfails black inside the sprite. Generated art is outlined in its own darkest color unless you ask for--outline-black.
To check that a finished sprite only uses its palette, and to snap stray colors back onto it, see Checks.
Palette swaps#
Onto another palette#
mode8 recolor moves finished art onto another palette, frame by frame, with no new colors and no dithering. Try it on a starter's hero, in a new project next to the first:
$ cd ..$ mode8 init castle --template platformer
✓ Created the platformer starter in castle/
26 assets · palette nes_master_gothic · lint 26/26 passed
hero, slime, ground, wall, window, pillar, ledge_left, ledge, ledge_right, stairs, +6 more + 10 UI pieces
UI kit → castle/godot/art/ui/ · font → castle/godot/art/font/
Godot project → castle/godot/ (runs main.tscn)
Next:
cd castle
godot -e --path godot
mode8 studio .
mode8 export hero$ cd castle$ mode8 recolor assets/hero/frames --target-palette nes_bone_knight --out-dir swaps/hero-bone
✓ Recolored 15 sprites → swaps/hero-bone/
11 colors mapped to nes_bone_knight
Next:
mode8 export swaps/hero-bone --out-dir swaps/exports/hero-bone --name hero-bone
Mode 8 splits both palettes into ramps (runs of one hue from dark to light, plus a gray ramp) and maps ramp to ramp, keeping each color's place from dark to light. The #000000 outline and transparency are never touched.
With your own color map#
When you want to say exactly which color becomes which, write a color map:
{
"#133f2b": "#450918",
"#2e6337": "#86101f",
"#558644": "#c22823",
"#85ad5a": "#e26847",
"#b4d178": "#ebc29a"
}$ mode8 recolor assets/slime/master.png --color-map red-slime.json --out-dir swaps/red-slime
✓ Recolored 1 sprite → swaps/red-slime/
5 colors mapped
! 2 colors had no mapping and were kept
Next:
mode8 export swaps/red-slime --out-dir swaps/exports/red-slime --name red-slimeThat turns the green slime red with colors from its own palette, nes_master_gothic, so the variant is still palette-locked. Colors the map does not name are kept, and the summary says how many.
At run time, in Godot#
One sprite can also swap palettes while the game runs: a red and a blue team, a hurt flash, a frozen enemy. --shader writes a Godot 4 shader, a small lookup texture with one row per palette, and a ShaderMaterial that ties them together:
mode8 recolor assets/hero/frames --shader --variants bone=nes_bone_knight,ember=nes_ember_beast --name hero --out-dir godot/art/hero_swap$ ls godot/art/hero_swap
hero_palette_swap.gdshader hero_palette_swap.tres hero_palettes.pngPut hero_palette_swap.tres on the sprite's material and pick a palette by number: 0 is the original colors, then the variants in the order you gave them.
$AnimatedSprite2D.material = preload("res://art/hero_swap/hero_palette_swap.tres")
$AnimatedSprite2D.material.set_shader_parameter("variant_index", 1) # boneThe swap is exact under any texture filter, and modulate still tints the result.
When it goes wrong#
- "palette ... not found": check the name with
mode8 list palettes. A project palette must be a.gplfile in the project'spalettes/folder. - A swap turns metal into cloth: the automatic mapping pairs ramps; give the colors you care about a color map.
- Generated colors look muddy on your palette: read the
palette_fitwarning; generate with an automatic palette and recolor afterwards.
Next#
- Sprites:
--paletteand--colorsin generation. - Terrain and props: procedural art drawn from the palette's ramps.
- Godot: the palette shader in a scene.