crestconvert
v0.1.0
Published
Private browser-side image conversion with HEIC, batch processing and ZIP output.
Maintainers
Readme
crestconvert
Private, browser-side image conversion with HEIC support. Files stay on the user's device and are never sent to a conversion server.
Built by Crest Convert, a private online file converter.
Supported formats
- Inputs: HEIC, HEIF, JPG, JPEG, PNG, WebP, GIF and BMP
- Outputs: JPG, PNG and WebP
- Animated GIF input is converted using its first frame
Install
npm install crestconvertConvert one image
import { convertImage, download } from "crestconvert";
const file = input.files[0];
const result = await convertImage(file, {
format: "jpg",
quality: 0.9
});
download(result.blob, result.filename);Convert a batch to ZIP
import { convertImages, createZip, download } from "crestconvert";
const images = await convertImages(input.files, {
format: "webp",
quality: 0.85,
maxFiles: 50,
onProgress: (completed, total, filename) => {
console.log(`${completed}/${total}: ${filename}`);
}
});
const zip = await createZip(images);
download(zip, "converted-images.zip");Privacy and runtime
All decoding, encoding and ZIP creation happen locally in the browser. The package makes no network requests and contains no analytics or tracking.
This package is designed for browser applications. It requires Canvas, Blob, File and createImageBitmap support. HEIC and HEIF decoding is provided by the bundled WebAssembly build of libheif-js.
API
convertImage(blob, options)converts one image.convertImages(blobs, options)converts a batch sequentially.createZip(images, options)creates a ZIP from converted results.download(blob, filename)starts a browser download.isSupportedImage(blob, filename?)checks input support.supportedInputFormatsandsupportedOutputFormatsexpose the format lists.
License
MIT. See THIRD-PARTY-NOTICES.md for dependency licensing.
