Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 14, 2026·3 min de lecture

Squoosh — Browser-Based Image Compression by Google

Squoosh is an open-source web app from Google Chrome Labs that compresses images using codecs like MozJPEG, AVIF, WebP, and OxiPNG directly in the browser with no server uploads required.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Squoosh Image Compression
Commande d'installation directe
npx -y tokrepo@latest install b35e42b3-7f1b-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Squoosh is a web application and CLI tool built by Google Chrome Labs that lets developers compress and convert images using modern codecs. It runs entirely in the browser via WebAssembly, so no image data ever leaves your machine. The CLI version brings the same codec power to build pipelines and automation scripts.

What Squoosh Does

  • Compresses images using MozJPEG, WebP, AVIF, OxiPNG, and other codecs in-browser via WASM
  • Provides a side-by-side visual comparison of original vs compressed output
  • Supports resize, reduce palette, and quantization controls per codec
  • Offers a Node.js CLI for batch processing in CI/CD pipelines
  • Outputs optimized images with no server round-trip or cloud dependency

Architecture Overview

Squoosh compiles each image codec (libjpeg, libwebp, libavif, oxipng) to WebAssembly so it runs at near-native speed inside the browser. The web app is a Preact-based PWA that uses Web Workers to keep the UI responsive during heavy encoding. The CLI wraps the same WASM modules in a Node.js process for headless batch use.

Self-Hosting & Configuration

  • Clone the repo and run npm install && npm run build to produce a static site
  • Serve the build/ directory behind any web server (Nginx, Caddy, S3)
  • No database or backend required; all processing happens client-side
  • The CLI is configured entirely via command-line flags per codec
  • Docker is not needed; a simple static file host is sufficient

Key Features

  • Zero data upload — all encoding runs locally in WebAssembly
  • Supports next-gen formats (AVIF, WebP, JPEG XL) alongside legacy JPEG/PNG
  • Real-time visual diff with a draggable slider for quality comparison
  • Works offline as a Progressive Web App after first load
  • CLI enables integration into GitHub Actions, Webpack, or custom pipelines

Comparison with Similar Tools

  • ImageOptim — macOS-only native app; Squoosh is cross-platform and browser-based
  • Sharp — Node.js library for server-side processing; Squoosh runs client-side via WASM
  • TinyPNG — cloud service with upload limits; Squoosh is fully local and unlimited
  • Imgproxy — server-side proxy for on-the-fly resizing; Squoosh is a standalone optimizer
  • Caesium — desktop GUI compressor; Squoosh adds a web UI plus CLI for automation

FAQ

Q: Does Squoosh upload my images to a server? A: No. All compression happens locally in your browser using WebAssembly. No data leaves your machine.

Q: Can I use Squoosh in a CI pipeline? A: Yes. The @squoosh/cli npm package lets you batch-compress images in any Node.js environment.

Q: Which codec should I choose for web delivery? A: AVIF offers the best compression ratio for photos, with WebP as a widely supported fallback. Use OxiPNG for graphics with transparency.

Q: Is the project still maintained? A: The web app remains functional. The CLI package is in maintenance mode; for heavy automation consider Sharp or libvips.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires