5 releases

0.1.4 Nov 27, 2024
0.1.3 Jul 27, 2024
0.1.2 Apr 5, 2024
0.1.1 Apr 4, 2024
0.1.0 Apr 4, 2024

#292 in Game dev

Download history 1/week @ 2024-08-17 1/week @ 2024-08-24 3/week @ 2024-08-31 16/week @ 2024-09-14 9/week @ 2024-09-21 30/week @ 2024-09-28 2/week @ 2024-10-05 1/week @ 2024-10-12 22/week @ 2024-10-19 42/week @ 2024-10-26 1/week @ 2024-11-02 6/week @ 2024-11-09 38/week @ 2024-11-16 177/week @ 2024-11-23 35/week @ 2024-11-30

256 downloads per month
Used in 2 crates (via chuot-macros)

MIT license

61KB
1.5K SLoC

SpriteDicing


crates.io CodeFactor CodeCov


Reuse repeating texture regions

Use SpriteDicing to split a set of sprite textures into units, discard identical ones, bake unique units into atlas textures to then seamlessly reconstruct the original sprites at runtime, without actually keeping original textures in the build.

The solution significantly reduces build size when multiple textures with identical areas are used. Consider a visual novel type of game, where multiple textures per character are used, each portraying different emotion; most of the texture space is occupied with identical data, while only a small area varies:

dicing illustration

These original five textures have total size of 17.5MB. After dicing, the resulting atlas texture will contain only the unique areas of the original textures and consume just 2.4MB, effectively compressing the textures by 86.3%.

Sprite Dicing is used in Naninovel — visual novel engine. Check it out!

naninovel banner

🎬 Get Started

https://dicing.elringus.com/guide/getting-started

No runtime deps