MCPcopy Index your code
hub / github.com/elringus/sprite-dicing

github.com/elringus/sprite-dicing @v3.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0.0 ↗ · + Follow
442 symbols 779 edges 44 files 19 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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%.

🎬 Get Started

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


Sprite Dicing is used in Naninovel: Visual Novel, Dialogue & Cutscene Storytelling Engine. Check it out!

naninovel banner

Extension points exported contracts — how you extend this code

AnySource (Interface)
(no doc) [2 implementers]
crates/lib/src/fixtures.rs

Core symbols most depended-on inside this repo

build
called by 24
crates/lib/src/builder.rs
tex
called by 18
crates/lib/src/fixtures.rs
defaults
called by 18
crates/lib/src/builder.rs
dice
called by 17
crates/lib/src/lib.rs
pack
called by 16
crates/lib/src/packer.rs
defaults
called by 13
crates/lib/src/packer.rs
dice1
called by 8
crates/lib/src/dicer.rs
dice_dir
called by 6
crates/cli/src/lib.rs

Shape

Function 175
Method 165
Class 98
Enum 3
Interface 1

Languages

Rust53%
C#43%
C++5%

Modules by API surface

plugins/unity/Assets/SpriteDicing/Editor/Native/Native.cs45 symbols
crates/lib/src/dicer.rs34 symbols
crates/lib/src/builder.rs34 symbols
crates/lib/src/packer.rs30 symbols
crates/lib/src/models.rs30 symbols
plugins/godot/addons/sprite_dicing/editor/native/src/sprite_dicing.cpp20 symbols
crates/abi/src/lib.rs19 symbols
plugins/unity/Assets/Tests/Editor/SourceLoaderTest.cs14 symbols
plugins/unity/Assets/SpriteDicing/Editor/Editors/AtlasBuilder.cs14 symbols
crates/abi/src/models.rs14 symbols
crates/tests/src/core.rs13 symbols
plugins/unity/Assets/Tests/Editor/AtlasImporterTest.cs12 symbols

For agents

$ claude mcp add sprite-dicing \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page