Losslessly Optimising Images

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • oxipng

    Multithreaded PNG optimizer written in Rust

  • I wonder how `pngcrush` compares to `oxipng` (https://github.com/shssoichiro/oxipng).

    Personally, I use `oxipng` if I want lossless compression. However, most of the time, I use `pngquant` instead, since it gives significant size reduction even at `99%` (I can't even distinguish between the original and reduced image).

        pngquant --quality=99 --ext=.png --force file.png

  • shrivel

    Command line wrapper utility to shrink a path of images for web based on external tools.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • libavif

    libavif - Library for encoding and decoding .avif files

  • ImageOptim

    GUI image optimizer for Mac

  • jpeg2png

    silky smooth JPEG decoding

  • This tool optimises blocky JPEGs for a better viewing pleasure: https://github.com/victorvde/jpeg2png

    > jpeg2png finds the smoothest possible picture that encodes to the given JPEG file.

  • squoosh

    Make images smaller using best-in-class codecs, right in the browser.

  • I am a bit surprised that no one has mentioned https://squoosh.app/ yet

  • guetzli

    Perceptual JPEG encoder

  • I've never had much luck using jpegoptim. In most cases it's only removing the metadata, which isn't much on high-res files.

    Guetzli is nice, if you don't have too many images to recompress (quite slow): https://github.com/google/guetzli

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • ImageOptim-CLI

    Make optimisation of images part of your automated build process

  • Disclaimer: There may be newer tools with better support for Linux or Windows, but for macOS users, the venerable "ImageOptim-CLI" project ^1 remains a powerful option.

    It wraps ImageOptim, ImageAlpha, and JPEGmini in a single executable, and is able to produce visually-indistinguishable image assets with 60-80% reduction in bytecount, for nearly any corpus of unoptimized files. I've used it to great effect as a webperf consultant. Enjoy! :)

    1. https://github.com/JamieMason/ImageOptim-CLI

  • zopfli

    Zopfli Compression Algorithm is a compression library programmed in C to perform very good, but slow, deflate or zlib compression.

  • zopflipng typically beats pngcrus and optipng (on Linux at least) but by default it drops auxillary PNG chunks [0] which can result in browsers (and other applications) using a different color space, causing the resulting images to look more washed out than the original. To prevent this you need to explicitly pass --keepchunks=cHRM,gAMA,pHYs,iCCP,sRGB,oFFs,sTER to zopflipng.

    Unfortunately it (and most other tools) don't have APNG support, keeping only the first frame.

    [0] https://github.com/google/zopfli/issues/113

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts