docs.rs failed to build slimg-core-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
slimg-core-0.4.0
slimg-core
Image optimization library for Rust. Decode, encode, convert, and resize images using best-in-class codecs.
Codecs
| Format | Decode | Encode | Encoder |
|---|---|---|---|
| JPEG | Yes | Yes | MozJPEG |
| PNG | Yes | Yes | OxiPNG (Zopfli) |
| WebP | Yes | Yes | libwebp |
| AVIF | macOS only | Yes | ravif (AV1) |
| QOI | Yes | Yes | rapid-qoi |
| JPEG XL | Yes | No | Decode only (GPL restriction) |
Usage
use *;
use Path;
// Decode from file
let = decode_file?;
// Convert to WebP at quality 80
let result = convert?;
result.save?;
// Convert and resize in one step
let result = convert?;
// Optimize in-place (re-encode same format)
let data = read?;
let optimized = optimize?;
optimized.save?;
Resize Modes
| Mode | Description |
|---|---|
Width(u32) |
Set width, preserve aspect ratio |
Height(u32) |
Set height, preserve aspect ratio |
Fit(u32, u32) |
Fit within bounds, preserve aspect ratio |
Exact(u32, u32) |
Exact dimensions (may distort) |
Scale(f64) |
Scale factor (e.g. 0.5 = half size) |
CLI
For batch processing and command-line usage, see slimg.
License
MIT