@wasm-zoo/libvips
v0.5.3
Published
libvips 8.18.7 compiled for browser WebAssembly by WASM Zoo, with Consumer API v1 and bundled runtime assets.
Maintainers
Readme
@wasm-zoo/libvips
Unofficial WASM Zoo distribution of the libvips image-processing library for browsers. This package is backed by libvips 8.18.7, Zoo builder 0.5.3, and the reviewed browser-core Release asset.
Install
npm install @wasm-zoo/libvipsUse
import { load } from "@wasm-zoo/libvips";
const runtime = await load();
try {
const vips = runtime.api;
const input = vips.Image.newFromBuffer(inputBytes);
const resized = input.resize(0.5);
const jpeg = resized.writeToBuffer(".jpg[Q=80]");
resized.delete();
input.delete();
console.log(jpeg);
} finally {
runtime.dispose();
}The default entry imports the reviewed browser wrapper and uses static new URL(..., import.meta.url) references so modern bundlers can emit vips.js, vips.wasm. For manual/self-hosted deployments use @wasm-zoo/libvips/self-hosted and the Consumer API v1 baseUrl contract.
This npm package intentionally bundles the browser-core profile only (JPEG/PNG/WebP). libvips uses pthreads and WebAssembly SIMD, so the hosting page must be cross-origin isolated and provide SharedArrayBuffer. Access the underlying wasm-vips/libvips API through runtime.api.
