Skip to content

andreialba/image-compressor

Repository files navigation

Free Local Image Compressor

A free, offline, privacy-first image compressor that runs entirely in your browser. Compress JPEG, PNG, and WebP images locally—no uploads, no server, no data leaves your device. Perfect for reducing file size for web, email, or storage while keeping your photos private.

Keywords: free image compressor, local image compressor, offline image compression, browser image compressor, compress images without uploading, private image optimizer, image size reducer, batch image compression, EXIF remover


Features

  • 100% local & offline — All compression happens in your browser; images never leave your machine
  • Free & open source — No sign-up, no paywall, no limits
  • Smart compression — SSIM-based quality targeting for optimal file size with minimal visible loss
  • Multiple formats — Convert between JPEG, PNG, and WebP
  • EXIF / metadata stripping — Remove GPS location, camera info, and other embedded data before download
  • Batch processing — Compress multiple images at once and download as a single ZIP file
  • Before/after comparison — Slider to compare original vs compressed side by side
  • Dark mode — Easy on the eyes in low light

How to Install and Run Locally

Prerequisites

  • Node.js (v18 or later recommended) — Download here if you don't have it

Step 1: Clone or download this repository

git clone https://github.com/YOUR_USERNAME/Image-Compressor.git
cd Image-Compressor

If you downloaded a ZIP file, extract it and open a terminal in that folder.

Step 2: Install dependencies

npm install

Step 3: Start the app

npm run dev

Step 4: Open in your browser

Go to http://localhost:3000 — the image compressor is now running on your machine.


Build for Production

To create a static build you can deploy or run without Node:

npm run build

The built files will be in the dist folder. You can:

  • Serve them with any static file server (e.g. npx serve dist)
  • Deploy to GitHub Pages, Netlify, Vercel, or any static host

Usage

  1. Drag & drop images onto the drop zone, or click to browse
  2. Paste images from your clipboard (Ctrl+V / ⌘V)
  3. Adjust settings (quality, format, EXIF stripping) in the right panel
  4. Click Start Processing to compress
  5. Download individual images or save all as a ZIP file

Security & Privacy Edge Cases

  • 100% local processing: images are never uploaded or sent over the network.
  • All processing is done with client-side scripts; verify browser-image-compression and JSZip versions are up-to-date.
  • Disable clipboard paste handling if the page is loaded in an insecure context (non-HTTPS in production).
  • Clear object URLs on every file removal and on unmount (avoids memory leaks and accidental caching).
  • For browsers with strict cross-origin policies, use safe fallback for image decoding by verifying createImageBitmap and Canvas availability.
  • Use optional stripExif setting to remove metadata and location data; default is enabled.
  • Validate MIME types on input files to prevent unsupported / malformed content.

Build & Release Polishing

  • Add standard scripts for lint/test/release in package.json:

    • npm run lint — run ESLint with TypeScript rules.
    • npm run test — run tests (add Jest/Playwright later).
    • npm run format — run Prettier.
    • npm run release — Bump version + build + tag.
  • Keep changelog and version in sync:

    • CHANGELOG.md with Unreleased section.
    • bump semver via npm version [patch|minor|major] + git push --follow-tags.
  • CI checklist:

    • Node 18+ environment
    • npm ci install dependencies
    • run npm run lint && npm run build && npm run test

Tech Stack

React, TypeScript, Vite, browser-image-compression, JSZip

About

Free local image compressor

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors