ScriptsJul 14, 2026·3 min read

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.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Squoosh Image Compression
Direct install command
npx -y tokrepo@latest install b35e42b3-7f1b-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

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

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets