Skip to content
Dus Mamud edited this page Nov 9, 2026 · 1 revision

FAQ

Is it really free? What does it cost to run?

Yes — MIT licensed, and it runs entirely on your visitors' devices, so there is no image-processing bill at all: no server, no per-image API fees. The one licence nuance: the HEIC decoder's engine (libheif/libde265) is LGPL-3.0, fenced inside @dusrel/image-heic; its wrapper, and everything else, is MIT.

Which formats can it read and write?

Built into the core: JPEG, PNG, WebP. With the codec packages: AVIF, JPEG XL and QOI (encode + decode), MozJPEG-grade JPEG, the Rust PNG encoder, lossless PNG optimisation (OxiPNG), animated GIF, SVG optimisation — and HEIC decode (iPhone photos), which is decode-only because HEVC encoding is patent-encumbered. See the Codec Guide.

Do I have to install all 24 packages?

No — that is the point of the family. Install @dusrel/image plus only the codecs and features you use; each package's WASM loads lazily, only when a format or feature is actually exercised.

The WASM file returns HTML in Vite dev — what's wrong?

Vite's dev pre-bundling relocates the codec code and breaks its relative asset URLs. Two verified fixes — exclude the codec packages from optimizeDeps, or pass explicit URLs with setCodecAssets — are on the Bundlers and Codec Assets page. Production builds are unaffected.

Do I need COOP/COEP headers or SharedArrayBuffer?

No. Every WASM build is single-threaded by design, so the library works in any page, iframe or embed without cross-origin isolation headers (ADR-0006).

How does the byte budget (maxSizeBytes) behave?

The engine binary-searches quality to land at or under the budget. If the budget honestly can't be met at the requested dimensions, the result tells you — targetSizeMet is false — instead of silently returning an oversized file or a destroyed image. Pair it with a resize when the budget is tight.

Does it work in Safari?

Yes — the full matrix (Chromium, Firefox, WebKit) runs on CI for every release. Safari 16.4+ is the floor for the worker-based paths, and HEIC decode is native there from Safari 17 (WASM fallback elsewhere). Details: Browser Support.

Can I use it without a bundler or a framework?

Yes. The flagship is framework-free, the crop UI is a plain Web Component, and examples/cdn in the repository shows an import-map page that runs entirely from CDN modules — the live playground is built that way.

Where is the full API reference?

dusmamud.github.io/dusrel-image/api — TypeDoc for all 25 entry points, generated from the shipped types.

Clone this wiki locally