Skip to content

v0.4.0

Choose a tag to compare

@capy-ai capy-ai released this 22 Nov 16:25
· 9 commits to main since this release

What's new

  • Much smaller PNGs: dithered images are now saved as indexed PNGs at the smallest bit depth the palette allows (1, 2, 4, or 8-bit), instead of full 32-bit RGBA. A 1024×1024 sphere went from 449 KB to 57 KB, a Game Boy mesh from 378 KB to 4 KB, and a PICO-8 noise texture from 2.9 MB to 207 KB. This covers generate, apply, batch, spritesheets, and --frames-dir. Pixels are unchanged.
  • Much smaller APNGs: all frames share one compact palette, and each frame after the first stores only the region that changed, the same way GIFs already did. A 24-frame 400×400 sphere loop went from 633 KB to 193 KB, smaller than the equivalent GIF.
  • About 4× smaller SVGs: --svg-shape rect now writes one compact <path> per color instead of a <rect> per run (a 512×512 sphere went from 1.4 MB to 351 KB). Circle and dot SVGs are about 13% smaller.
  • Clear error for mixed frame sizes: an APNG built from frames of different sizes now fails with a message that names the mismatched frame.
  • Skill docs updated: PNG is now usually the smallest still format, and the hero recipe writes .png instead of lossless .webp, which is now about 3× larger.

Behavior change

SVG rect output now uses <path> elements rather than <rect> elements, and saved PNGs use indexed or RGB color types instead of always RGBA. Both render identically, but tools that parse the markup or expect RGBA PNGs may need updating. Saving very large, noisy PNGs is slightly slower because of the stronger compression.

Install / update

curl -fsSL https://raw.githubusercontent.com/lassejlv/dith/main/install.sh | bash
# or
dith update