A tiny, dependency-free tool to compress and resize images in the browser.
- Choose an image
- Set quality and max dimensions
- Preview original vs compressed
- Download the result (WEBP if supported, otherwise JPEG)
Just open index.html in a browser (no build step).
index.html– markup and controlsstyles.css– minimal UIscript.js– compression logic (Canvas API)
- Read the file with an
<input type="file"> - Draw to
<canvas>(optionally scaled down) - Export via
canvas.toBlob(type, quality)to WEBP/JPEG - Trigger a download with an
<a download>link
- Uses
URL.createObjectURLto preview and download. - Chooses WEBP when supported; falls back to JPEG.
- No external libraries.