Repository navigation
Releases
Releases · lassejlv/diths
v0.5.0
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. --optimizefor the smallest PNG and APNG: a new flag onapply,generate,animate,compare,batchandpreset save. It searches palette orders and PNG filters and compresses with Zopfli, so files come out 3–25% smaller and matchoxipng -o max -Zto 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 asexport.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, andinstall.shanddith updatesupport 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-recipeJSON now always includes"optimize"in its export section.
Install / update
curl -fsSL https://raw.githubusercontent.com/lassejlv/dith/main/install.sh | bash
# or
dith updatev0.4.0
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 rectnow 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
.pnginstead 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 updatev0.3.0
What's new
- Much smaller animated GIFs: frames are now delta-encoded, so each frame after the first stores only what changed. Animations with static areas shrink dramatically (an 800×600, 36-frame blue-noise sphere went from 2.3 MB to 250 KB); GIFs where every pixel changes stay about the same size.
dith animate --max-size 2MB: set a file-size budget (500KB,1.5MiB, or bytes). dith shrinks the frame dimensions, keeping frame count and fps, until the output fits, and reportssize_fit_scalein the JSON.- Motion is documented:
dith list generators --jsonnow has amotionfield describing what each pattern does when animated. - Temporal stability is documented:
dith list algorithms --jsonnow hastemporally_stable. With--temporal locked, ordered screens, blue-noise, ign, and random keep static pixels identical; error-diffusion algorithms still shimmer around moving content. - Cleaner procedural highlights: the sphere's highlight now rolls off smoothly instead of clipping into a flat white patch.
- Skill docs updated for all of the above.
Behavior change
With --preset, procedural sources (generate, animate <pattern>, compare --pattern, preview --pattern) now skip the preset's photo preparation (auto-levels, contrast, sharpen), which clipped clean gradients. Pass those flags explicitly to get the old behavior. Output for these commands differs from v0.2.0.
Install / update
curl -fsSL https://raw.githubusercontent.com/lassejlv/dith/main/install.sh | bash
# or
dith updatev0.2.0
What's new
- Agent skill install without npx:
install.shdetects installed coding agents (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, GitHub Copilot, Windsurf, Factory Droid, shared~/.agents), asks for confirmation, and copies the dith skill into each one. Use--yes(orDITH_YES=1) to skip the prompt,--no-skillsto skip skills entirely. dith updaterefreshes skills natively: after updating the binary it copies the release's skill into every detected agent, with no Node.js required. The JSON report lists the agents inskills_agents.- Much more detailed agent skill: style guide, craft rules, verification checklist, full CLI reference with JSON report fields and error codes, a catalog of presets/palettes/algorithms/generators, and ~20 tested recipes (web heroes, OG cards, logo SVGs, CSS spritesheets, reveal GIFs, brand presets, batch export).
Install / update
curl -fsSL https://raw.githubusercontent.com/lassejlv/dith/main/install.sh | bash
# or
dith updatev0.1.0
Full Changelog: https://github.com/lassejlv/dith/commits/v0.1.0