DEV Community

yangjiaqiang12
yangjiaqiang12

Posted on

I Built a Free Image Compressor That Never Uploads Your Files

The Problem

Every time you use an online image compressor, your files get uploaded to someone else's computer. TinyPNG does it. Compressor.io does it. Even most so-called "free" tools collect your data on their servers.

This has always felt wrong to me. Images can contain sensitive stuff -- screenshots of conversations, private photos, business documents, unreleased designs. Why should making them smaller require handing them to a stranger?

The Solution: Squash

Squash is a free, open-source image compressor that runs entirely in your browser.

  • 🚫 No uploads -- everything stays on your device
  • Instant compression -- no waiting for network round-trips
  • 🎨 Multi-format -- JPEG, PNG, WebP support
  • 📦 Batch processing -- compress multiple images at once
  • 🎚️ Quality slider -- full control from 1% to 100%
  • 📐 Resize -- set max dimensions while compressing
  • 🌓 Dark mode -- works great at night
  • 💰 Completely free -- no limits, no watermarks

How It Works

Squash uses the browser Canvas API to decode images, apply compression settings, and re-encode them at your chosen quality level. All the heavy lifting happens on your device hardware -- not on some server farm.

The processing pipeline:

  1. Load -- Image is decoded from file into raw pixel data
  2. Resize -- If a max width is set, image is scaled down
  3. Encode -- Pixel data is re-encoded at the chosen quality and format
  4. Download -- The compressed result is ready to save

No server. No upload. No privacy concern.

Why I Built This

I wanted a tool that respects privacy. Not as a marketing slogan -- as a technical guarantee. Your images literally cannot be uploaded because there is no server to upload them to. The entire application is static HTML, CSS, and JavaScript served from GitHub Pages.

The source code is open (MIT license). You can inspect every line. You can host it yourself. You can verify that nothing leaves your browser.

Comparison with Other Tools

Tool Privacy Batch Mode WebP Support Price
Squash ✅ Local only ✅ Yes ✅ Yes Free
Squoosh ✅ Local only ❌ No ✅ Yes Free
TinyPNG ❌ Uploads ✅ Yes ✅ Yes Free (20/day)
Compressor.io ❌ Uploads ✅ Yes ❌ No Free (10MB cap)

The key difference: Squash and Squoosh process locally. But Squoosh has no batch mode. Squash is the only tool that combines local processing + batch mode + multi-format + unlimited use.

Tech Stack

  • Vanilla HTML/CSS/JavaScript -- No frameworks, no dependencies
  • Canvas API -- Browser-native image processing
  • GitHub Pages -- Free, fast static hosting
  • Zero backend -- No server, no database, no API calls

Try It Yourself

👉 Launch Squash

📂 Source Code on GitHub

If you find it useful, consider buying me a coffee ☕ -- it helps keep the project alive and improving.


Built with vanilla HTML/CSS/JS. No frameworks, no dependencies, no build step. MIT licensed.

Top comments (0)