explaingit

google/guetzli

12,938C++Audience · developerComplexity · 2/5Setup · moderate

TLDR

A command-line tool from Google that makes JPEG image files 20-30% smaller without visible quality loss, by modeling how human eyes perceive images during compression instead of using a fixed formula.

Mindmap

mindmap
  root((guetzli))
    What it does
      JPEG compression
      20-30% size reduction
      Human vision model
    Inputs
      PNG files
      JPEG files
    Limitations
      No transparency
      Slow processing
    Tech Stack
      C++
      libpng
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Reduce your website's JPEG image sizes by 20-30% to make pages load faster, with no visible quality difference to visitors.

USE CASE 2

Compress product photos before uploading to an e-commerce site to reduce storage and bandwidth costs.

USE CASE 3

Optimize screenshots or illustrations in a web app or documentation site by running them through Guetzli before deployment.

Tech stack

C++libpng

Getting it running

Difficulty · moderate Time to first run · 30min

Building from source requires a C++ compiler and libpng, processing takes about 1 minute per megapixel and 300 MB RAM per megapixel.

In plain English

Guetzli is a tool from Google that compresses JPEG image files more efficiently than standard JPEG encoders. When you give it a photo, it produces a JPEG that looks the same to the human eye but is typically 20 to 30 percent smaller in file size compared to what most other JPEG tools produce at the same quality setting. The way it achieves this is by modeling human visual perception: instead of just applying a fixed compression formula, Guetzli tries many different encodings and picks the one where the result looks best to a human viewer for a given file size. This process is slow and memory-intensive. Expect it to take about one minute of processing time per megapixel of input image, and about 300 megabytes of memory per megapixel as well. You run Guetzli from the command line, giving it a PNG or JPEG file as input and specifying where to write the output JPEG. There is an optional quality setting that works on the same scale as common JPEG tools, so you can compare directly. It does not support transparency: if your input PNG has a transparent background, that area will become black in the output. Building it requires a C++ compiler and the libpng library. Instructions are provided for Linux, macOS, and Windows. On macOS it can also be installed directly via Homebrew with a single command.

Copy-paste prompts

Prompt 1
I have a folder of JPEG product photos and want to compress all of them with Guetzli to reduce file sizes. Show me a bash script to process them in batch.
Prompt 2
I'm building an image optimization step in my deployment pipeline. How do I call Guetzli from a Node.js or Python script to compress JPEGs before uploading to a CDN?
Prompt 3
I have PNG images with transparent backgrounds that I want to compress as JPEGs. Can Guetzli handle them, and if not, what should I use instead?
Prompt 4
Show me how to install Guetzli on macOS with Homebrew and compress a single JPEG at a specific quality setting from the command line.
Open on GitHub → Explain another repo

← google on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.