Skip to content

How to Choose Max Colors (Without Guessing)

A color-budget guide for pixel conversion: pick maxColors based on output purpose, not trial-and-error alone.

Color budget by use case

Treat maxColors as a production constraint, similar to file size or readability targets.

  • Favicon/icon: 4-12 colors
  • Avatar/PFP: 16-32 colors
  • Photo-style poster: 32-64 colors
  • Sprite animation: 8-24 colors

How to diagnose wrong color budgets

Visual symptoms tell you whether to increase or decrease maxColors.

  • Flat and lifeless gradients: increase maxColors
  • Muddy noisy regions: decrease maxColors
  • Brand colors drift: use fixed palette before increasing color count

Decision process in two passes

Pass 1 sets shape readability; pass 2 restores enough detail. This avoids endless random tweaking.

  • Pass 1: choose pixel size first, then set low color count
  • Pass 2: raise maxColors in small steps (+4 or +8) until details recover