Our great sponsors
-
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.
-
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.
-
zopfli
Zopfli Compression Algorithm is a compression library programmed in C to perform very good, but slow, deflate or zlib compression.
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
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.
I am a bit surprised that no one has mentioned https://squoosh.app/ yet
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
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
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