The refilelabs/image repository provides core utilities for image manipulation within the re;file labs platform. All operations run securely in the browser, powered by WebAssembly.
- Image Conversion: Convert images between a wide range of formats (JPEG, PNG, WebP, AVIF, and more).
- Image Resizing: Resize images while preserving aspect ratio.
- Image Compression: Reduce file size without sacrificing quality.
- Image Viewing: View images in a responsive, interactive viewer.
- Metadata Editing: Read, edit, and strip metadata (EXIF, GPS) for supported formats.
- Bun — package manager and runtime
- Rust — for compiling WebAssembly
- wasm-pack — for building WASM modules
git clone https://github.com/refilelabs/image.git
cd image
bun installbun install triggers postinstall, which runs wasm:bundle to compile the Rust crate into three WASM targets (bundler, node, web) under wasm/pkg/.
bun devInclude the image layer in your Nuxt project via the extends feature:
export default defineNuxtConfig({
extends: ['github:refilelabs/image'],
})The @refilelabs/image package exports the WASM module. The correct build is selected automatically based on your environment:
| Environment | Build used |
|---|---|
| Bundler (Vite, Webpack, Rollup) | bundler — no init() needed |
| Node.js | node — uses fs for WASM loading |
Raw browser (<script type="module">) |
web — explicit init() required |
See wasm/README_JS.md for the full JavaScript API reference.
refilelabs/image
├── .playground/ # Dev playground for testing
├── wasm/ # Rust crate + WASM build output
│ ├── src/ # Rust source
│ ├── scripts/ # Build scripts (build.ts)
│ └── pkg/ # Generated WASM packages (bundler/, node/, web/)
├── components/ # Vue components
├── composables/ # Vue composables
└── workers/ # Web Workers for compute-intensive tasks
This project is licensed under the MIT License. See the LICENSE file for details.
re;file labs — Your secure, private file utility suite.