Zero-backend by design
Every operation runs on the visitor's device. Images never leave the tab, so there is nothing to host, scale or pay for.
Compress, crop, resize, rotate and convert images entirely in the browser. No backend, no uploads, no server cost — with WASM codecs and maximum developer control.
import { processImage } from '@dusrel/image';
const { blob, report } = await processImage(file, {
format: 'image/webp',
maxSizeBytes: 200_000, // byte budget — the engine searches quality for you
});There is no upload endpoint, so there is nothing to leak, breach or subpoena. Your users' photos never leave their device — compliance reviews get very short.
The visitor's CPU does the work. No image servers to host, scale, patch or pay for — a static site and this library are the whole infrastructure.
Single-threaded WASM by default: no SharedArrayBuffer, no COOP/COEP headers, no cross-origin isolation. Drop it into any page, widget or webview.
import { processImage } from '@dusrel/image';
const { blob, report } = await processImage(file, {
format: 'image/webp',
quality: 0.8,
resize: { width: 1600 },
crop: { x: 80, y: 60, width: 640, height: 480 },
});
console.log(report.stepsApplied, report.savingsRatio);import { pipeline, codecPlugin, imageDataPlugin } from '@dusrel/image';
import { encode } from '@dusrel/image-avif';
import { adjust } from '@dusrel/image-adjust';
const { blob } = await pipeline(file)
.resize({ width: 1200 })
.use(imageDataPlugin({ name: 'adjust', transform: (d) => adjust(d, { saturation: 0.1 }) }))
.use(codecPlugin({ mimeType: 'image/avif', encode: (d) => encode(d, { quality: 55 }) }))
.run();import { useProcessImage } from '@dusrel/image-react';
function Compressor() {
const { process, processing, progress, result } = useProcessImage();
return (
<>
<input type="file" accept="image/*" onChange={(e) => {
const f = e.target.files?.[0];
if (f) void process(f, { format: 'image/webp', quality: 0.8 });
}} />
{processing && <progress value={progress} max={1} />}
{result && <img src={URL.createObjectURL(result.blob)} alt="" />}
</>
);
}| Group | Packages | What's inside |
|---|---|---|
| Core | 2 | @dusrel/image (flagship) + the zero-dependency canvas engine |
| Codecs | 10 | MozJPEG, libwebp, libavif, Rust PNG/QOI, OxiPNG, quantize, resize, libjxl, libheif (HEIC decode) |
| Features | 9 | Crop component, transform, adjust, metadata, watermark, batch, GIF, SVG, placeholders |
| Frameworks | 3 | React, Vue and Svelte bindings with typed crop components |
See all 24 packages → · Cookbook: tasks mapped to packages →
Every package's browser spec runs on CI in Chromium, Firefox and WebKit (Playwright) — the 1.0.x releases are green on all three.
| Chrome / Edge | Firefox | Safari | |
|---|---|---|---|
| Core + canvas formats | (16.4+ for the worker path) | ||
| WASM codecs | |||
| HEIC decode | WASM fallback | WASM fallback | Native (17+), WASM elsewhere |
Full support matrix and known quirks →
Yes — MIT licensed (the HEIC decoder's engine is LGPL-3.0, fenced inside its own package; see ADR-0008). Running cost is zero: all processing happens on your visitors' devices.
Built in: JPEG, PNG, WebP. Register a codec package to add AVIF, JPEG XL, QOI and GIF — plus MozJPEG/libwebp/Rust-PNG encoders that outperform the canvas ones. HEIC is decode-only (there is no permissively licensed HEVC encoder).
Vite's dev pre-bundling relocates the codec code and breaks its relative asset URLs. Exclude the codec packages from optimizeDeps, or pass explicit URLs with setCodecAssets — both fixes are written up in Bundlers & codec assets.
No. The default builds are single-threaded and need no SharedArrayBuffer. Just serve .wasm as application/wasm, which every static host does by extension.
Give maxSizeBytes and the engine searches quality for you. result.targetSizeMet reports honestly whether the budget was met — the smallest best-effort result is returned either way.
The playground runs the whole family live — no install, no uploads.