skia-rs-codec
Image encoding and decoding for skia-rs, a pure Rust implementation of the Skia 2D graphics library.
Features
- Image: Immutable image with pixel access
- PNG: Read/write support
- JPEG: Read/write support
- GIF: Read/write support
- WebP: Read/write support
- Format detection: Automatic format identification
Feature Flags
| Feature | Default | Description |
|---|---|---|
png |
✅ | PNG codec |
jpeg |
✅ | JPEG codec |
gif |
✅ | GIF codec |
webp |
✅ | WebP codec |
Usage
use ;
// Load an image
let image = from_file?;
// Get image info
println!;
// Detect format from bytes
let format = from_bytes;
// Encode to PNG
let png_data = image.encode_png?;
License
MIT OR Apache-2.0
See the main repository for more information.