brushkit
Rust crates for reading brush files and rendering their tip shapes.
- Photoshop
.abr(versions 2, 6 and 10): brush names, tip bitmaps, sampled and computed tips, embedded patterns. - Procreate
.brushand.brushset: brush names, set order, tip shapes. - Tip rendering: grayscale bitmaps, thumbnails and contact-sheet grids.
Crates
| Crate | Purpose |
|---|---|
brushkit |
One dependency over the two below, as brushkit::abr and brushkit::preview. |
brushkit-abr |
Reader for .abr files. Parses the pack into brushes with names, tip bitmaps or computed geometry, and patterns. |
brushkit-preview |
Tip bitmaps for any supported file: decodes sampled tips, synthesizes computed tips, reads Procreate Shape.png, and lays out contact sheets. |
brushkit-fixture |
Generates synthetic .abr files for tests and fuzzing. |
The public contract of brushkit-preview:
;
;
;
Every brush in file order appears exactly once, available or not. max_cell
is the largest side of every returned tip, so a caller gets thumbnails sized
for its grid without decoding a whole pack at full size. A .brushset without
brushset.plist is read in zip order and has no set name.
Building
cargo build
cargo test
cargo +nightly fuzz run abr_parse # optional, needs cargo-fuzz
See fuzzing instructions for all targets and seed regeneration.
The crates compile for wasm32-unknown-unknown as well as native targets.
Real-file tests
Real brush packs are copyrighted and are not part of the repository. Tests
that assert facts about real files read BRUSHKIT_CORPUS_DIR and are skipped
when it is unset. Synthetic fixtures from brushkit-fixture cover the parsing
mechanics without it.
License
MIT. See LICENSE.