// the find
elringus/sprite-dicing
Cross-engine tool for lossless compression of sprites with identical regions
SpriteDicing splits a set of sprite textures into small tiles, drops the ones that are byte-identical, and repacks the survivors into an atlas that gets reconstructed at runtime — aimed at things like visual novel character sprites where five emotion variants share 90% of the same pixels. It's for Unity and Godot devs shipping large sprite sets who want a smaller build without hand-deduping assets.
The core is a Rust library plus a C ABI (with a checked-in sprite_dicing.h), so the Unity and Godot integrations are thin bindings over one shared implementation instead of two forked ports that drift apart. The test fixtures are unusually honest about edge cases — 1x1/1x2 sizes, per-edge trim cases, and exotic formats like DDS, TGA, and WebP — which suggests these came from real bugs, not a happy-path demo. It's already load-bearing in a real product (Naninovel), and has CI for lint, rust tests, and the Unity plugin separately, plus Codecov wired in.
The Godot plugin ships precompiled native binaries (.dll/.dylib/.so) directly in the repo rather than as CI-built release artifacts, which is a supply-chain smell and means you're trusting a checked-in binary blob rather than something you can audit a build log for. The technique only collapses tiles that are pixel-identical, so any anti-aliasing, dithering, or sub-pixel offset between 'duplicate' regions defeats it entirely — the compression ratio in the README is a best case that depends on disciplined asset production, not something you get for free. Cross-platform coverage for the native extension is whatever those three checked-in binaries cover; there's no visible build matrix for less common targets like Linux ARM or mobile. There's also no versioned ABI compatibility doc, so anyone binding a third engine has to read the C header cold.