Ranked by what they are actually best at. Compression ratio, speed and scriptability pull in different directions, so the honest ranking depends on whether you are running a build step, batch-processing an archive or fixing one screenshot.
A Node library wrapping libvips, and dramatically faster than ImageMagick on resize-heavy work because libvips streams rather than loading whole images into memory. It resizes, converts to AVIF, WebP or JPEG, strips metadata and composites, all in one pipeline. If you generate responsive variants in a build, this is the tool: one script produces your entire size ladder in every format from a single source.
avifenc -s 6 --min 20 --max 40 in.png out.avif. AVIF consistently produces the smallest files for photographic content at matched visual quality, with better handling of gradients and flat colour than WebP. The cost is encoding time, which is orders of magnitude slower than JPEG at low speed settings. Perfect for build-time encoding, wrong for on-request transformation without a cache.
cwebp -q 80 in.png -o out.webp. Universally supported, fast to encode, and a solid improvement on JPEG at the same quality. Use -lossless for graphics with flat colour, and -q 80 as the starting point for photographs. When you need one format that works everywhere with no fallback logic, it is this one.
pngquant --quality=65-85 --skip-if-larger img.png. It reduces the image to a palette, which is lossy but frequently halves the file with no visible difference on screenshots, illustrations and UI graphics. Far more effective than lossless optimisers on exactly the images people optimise most.
oxipng -o4 --strip safe *.png. Multithreaded Rust rewrite of the optipng idea. Guaranteed pixel-identical output, so you can run it over an entire asset directory without reviewing the results. Pair it after pngquant for a further few percent.
jpegoptim --max=82 --strip-all re-encodes in place and removes metadata, including GPS coordinates from phone photos. mozjpeg's cjpeg -quality 80 produces smaller JPEGs than libjpeg at the same quality through better trellis quantisation. Both matter mostly for legacy pipelines where you cannot change format.
svgo --multipass logo.svg. Disable removeViewBox or the SVG stops scaling, and disable cleanupIds if you use sprites or reference IDs from CSS. A logo shipped as PNG is the most common avoidable weight on a page.
magick in.jpg -resize 1600x -quality 82 out.jpg. Slower and heavier than sharp, but it reads formats nothing else will, handles colour profiles properly, and is already installed nearly everywhere. The right tool for a one-off conversion and the wrong one for a hot path.
Resize before you compress. A 4000-pixel source saved at quality 60 will always look worse and weigh more than a 1600-pixel source at quality 82. Every tool above is a rounding error next to serving an image at the size it is displayed.