img-toolkit-rust is a high-performance image processing library rewritten in Rust (WASM) from the original TypeScript-based img-toolkit. Leveraging WebAssembly, this version provides faster, more efficient, and reliable image manipulation directly in browsers.
- ⚡ Fast & Efficient: Powered by Rust and WebAssembly.
- 📸 Supports JPEG, PNG, WebP formats.
- 📐 Resizing with automatic aspect-ratio handling.
- 🎚️ Adjust brightness easily.
- 🔍 Multiple resampling filters (Nearest, Triangle, CatmullRom, Gaussian, Lanczos3).
| Option | Type | Description |
|---|---|---|
width |
number | (Optional) Target width in pixels. If omitted, width is auto-adjusted. |
height |
number | (Optional) Target height in pixels. If omitted, height is auto-adjusted. |
quality |
number | Image quality level ranging from 0.0 (lowest) to 1.0 (highest quality). |
format |
string | Output format ("jpg", "png", "webp"). |
brightness |
number | (Optional) Brightness level from 0.0 (darkest) to 1.0 (brightest). Defaults to 0.5 if omitted. |
resampling |
number | (Optional) Resampling quality from 0 (fastest) to 10 (highest quality). Defaults to 4 if omitted. |
# Build Rust -> WASM
wasm-pack build --target web
# Build TypeScript wrapper
tscThis repository is a staging version rewritten in Rust from the original img-toolkit (TypeScript). Once fully stabilized and tested, this will replace the main library.
MIT