aseprite-io
Read and write Aseprite .ase/.aseprite files in Rust.
The only Rust crate that supports both reading and writing the Aseprite binary format, with byte-perfect round-trip fidelity.
Features
- Full Aseprite file format support: RGBA, Grayscale, and Indexed color modes
- All layer types: normal, group, and tilemap
- Animation tags, slices (with nine-patch and pivot), user data with typed properties
- Tileset support (embedded and external)
- Linked cels, cel extras, legacy mask chunks
- Byte-perfect round-trip: read a file and write it back to get identical bytes
Usage
Add to your Cargo.toml:
[]
= "0.1"
Reading a file
use AsepriteFile;
let data = read?;
let file = from_reader?;
println!;
for layer in file.layers
Creating a file from scratch
use *;
let mut file = new;
let layer = file.add_layer;
let frame = file.add_frame;
let pixels = new?;
file.set_cel?;
write?;
Feature flags
| Feature | Description |
|---|---|
image |
Conversions between Pixels and image::RgbaImage |
tiny-skia |
Conversions between Pixels and tiny_skia::Pixmap (handles premultiplied alpha) |
Alternatives
| Crate | Read | Write | Tilemaps | User data |
|---|---|---|---|---|
| aseprite-io | Yes | Yes | Yes | Yes |
| asefile | Yes | No | Yes | Partial |
| aseprite-loader | Yes | No | No | No |
License
MIT OR Apache-2.0