beautiful-image

Compress images
without sacrificing quality.

Powered by Rust/WASM runs in the browser and on the server with zero native dependencies.

$npm install beautiful-image

Browser

Canvas API for GPU-accelerated decode and resize. WASM handles sharpening and JPEG encoding.

Serverless

Full pipeline in pure WASM. No native binaries. Deploy to Lambda as a plain zip, no layers needed.

API

Chainable methods: resize, sharpen, blur, brightness, contrast, hueRotate, grayscale, invert.

Quality

Tuned JPEG encoding produces the smallest file while keeping images visually sharp and clean.

Same API, anywhere.

One import for the browser, one for Node.js. Everything else is identical.

import { image } from 'beautiful-image'

const result = await image(file)
  .resize(1200)
  .sharpen()
  .toJpeg(80)

document.getElementById('preview').src =
  URL.createObjectURL(result.blob)

// result.blob              optimized Blob
// result.originalSize      original file size
// result.compressionRatio  e.g. 0.72 = 72% smaller