Skip to content

v0.5.0

Latest

Choose a tag to compare

@capy-ai capy-ai released this 24 Nov 12:41

What's new

  • WebP is now smaller than PNG: a new palette-aware lossless WebP encoder replaces the old one, which stored every pixel as full colour. A 1200×800 photo with the editorial-print preset went from 391 KB to 81 KB (PNG: 83 KB), and a 3000×2000 auto-palette-64 image from 7.9 MB to 1.3 MB. Across 25 test images, WebP is now 2–20% smaller than dith's PNG and within 11% of cwebp -lossless -z 9. Pixels are identical.
  • --optimize for the smallest PNG and APNG: a new flag on apply, generate, animate, compare, batch and preset save. It searches palette orders and PNG filters and compresses with Zopfli, so files come out 3–25% smaller and match oxipng -o max -Z to within 0.3%. Encoding takes a few seconds per image. Without the flag, output is byte-identical to v0.4.0. It's also recorded in recipes as export.optimize.
  • About 2× smaller rect SVGs: each colour's runs are now drawn as one stroked path. They render pixel-identically to before.
  • Circle and dot SVGs are 70–80% smaller gzipped: dots are now traced as arc paths in one <path> per colour instead of a <circle> per pixel.
  • TIFF and BMP are no longer raw 32-bit: TIFF is Deflate-compressed (an 800px image went from 2.5 MB to 32–80 KB). BMP uses a 1-, 4- or 8-bit palette when the image is opaque with at most 256 colours.
  • Linux ARM binaries: releases now include aarch64-unknown-linux-gnu, and install.sh and dith update support it.
  • Half-size binary: release builds now use fat LTO and are stripped (6.0 MB → 3.3 MB on Linux, and slightly faster).

Behavior change

  • SVG markup changed. Rect output now uses stroked <path>s instead of filled boxes, and circle/dot output uses arc paths instead of <circle> elements. Both render the same, but tools that parse the markup may need updating. Uncompressed dot SVGs are 9–15% larger raw; the savings show up once the file is gzipped.
  • BMP and TIFF layouts changed. BMP is written at a lower palettized bit depth and TIFF as Gray8, RGB8 or RGBA8 with Deflate. Pixels are unchanged.
  • WebP encoding is slower: 30 ms to about 1 s for images up to 1200×800, and several seconds for very large images with more than 16 colours.
  • --emit-recipe JSON now always includes "optimize" in its export section.

Install / update

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