The GIF image format is commonly used for short animated images while JPEG is for higher quality photos using lossy compression to reduce file sizes. PNG is good on smaller and transparent pictures because it’s lossless and you don’t lose quality. The newer WebP is dual role because you can compress images with either lossless or lossy compression but it’s a bit less compatible than JPEG and PNG.
You can easily find many tools on the Internet to compress image files but most, if not all of them produce different file sizes. Reducing the image file size as much as possible helps to save bandwidth cost, reduce time to download, and even achieve a higher Google PageSpeed score because “optimize images” is one of the priorities.
In this article, we look at 17 free PNG and WebP lossless compressor tools (online, command line, desktop GUI) and also find which ones produce the smallest file sizes while preserving image quality. This is not a PNG vs WebP article as it’s about which PNG tools compress a PNG better and which WebP tools compress WebP better. It’s up to you to decide which format best suits your needs.
Note that we are not including options that don’t allow lossless compression on both PNG and WebP. Popular converters like the online TinyPNG will therefore be missing. The maximum available compression setting is listed and used for each program or service.
1. Pingo / Pinga (PNG and WebP)
Pingo is interesting because it’s one of the few command line tools that can compress both PNG and WebP images using lossless (and lossy) compression. In addition to those two formats, Pingo is also able to compress JPG and APNG files along with a simple ability to resize images, convert to greyscale, enhance details, and remove transparency.
Pingo maximum compression for PNG:
Pingo -s9 image.png
Pingo maximum compression for WebP:
Pingo -webp-lossless -s9 image.png
Pinga is a GUI interface for Pingo but is limited to just PNG and JPG compression. All you have to do is enable Extreme compression from the dropdown and uncheck Lossy Compression in the Settings to get the same output as Pingo. It’s also considered experimental so could be a bit buggy.
2. ECT (Efficient Compression Tool) (PNG)
There are a couple of things that make ECT a potentially useful tool. Firstly, it can compress JPEG, Zip, and GZip files in addition to PNG. Also, it’s the most up to date tool here with the latest release only a couple of days old. ECT is open source and cross platform with a Mac OS version available. If you just supply a folder to the command, it will process and compress all files in that folder.
ECT maximum compression command:
ECT.exe -9 image.png [or folder path]
3. advpng (PNG)
Advpng is part of AdvanceCOMP that contains multiple free utilities to recompress Zip archives, PNG, MNG, and GZ files. After a gap of four years, AdvanceCOMP had a new release in 2022 although it was only compatibility fixes. The maximum “Insane” compression mode can be a bit slower on older machines but modern computers won’t see a compression time of more than a few seconds for a moderate size image.
Versions are open source and available for Windows, DOS, Mac OS, and Linux. Advpng maximum compression command:
advpng.exe -z4 file.png
4. Squoosh (PNG and WebP)
It might come as a surprise to some, but Squoosh is actually an online file compressor and basic image editor from GoogleChromeLabs. Essentially, GoogleChromeLabs is a bunch of side projects created by the Google Chrome developers. Besides JPEG and AVIF, Squoosh also supports compressing PNG and WebP using both lossy and lossless methods.
After dropping an image onto the browser window or loading it manually, select OxiPNG or WebP from either the left or the right dropdown menu. For OxiPNG, just slide the Effort slider to 3 to hopefully get a few more KB savings over the default of 2. For WebP, check the Lossless box, slide Effort to 9, and Slight loss to 0 (it appears to perform some light lossy compression).
It is useful that Squoosh shows what the changes to the compression settings do to the size of the image file before you download it. This is a potential saver of time and downloading multiple images just to see what setting works best.
5. OptiPNG (PNG)
OptiPNG is another open source command line PNG compressor that supports Windows and Linux. In addition to directly compressing a PNG, it can also convert BMP, GIF, PNM, and TIFF to compressed PNG. The highest level of compression is the “very Slow” 07 although the default is 02.
OptiPNG maximum compression command:
optipng.exe -o7 file.png
6. IrfanView (PNG and WebP)
IrfanView is one of the most popular and best image viewers for Windows and has been for many years. A powerful feature in IrfanView is the batch editor that can edit multiple files with tons of different settings. It also includes the ability to simply compress PNG and WebP files using either lossy or lossless methods.
Note the OptiPNG plugin requires downloading and installing the IrfanView Plugins pack (which is recommended anyway). The internal PNG compressor doesn’t compress that great so the OptiPNG plugin is required to get good results. Once IrfanView is open, press B to open the batch conversion window. Firstly, browse for your image(s) and use the buttons to add what you want to the input list.
For PNG, select PNG from the Output format dropdown. Select Options to the right, check the OptiPNG box and set the level to the maximum of 7. Press OK and then Start Batch. You can try the internal “Compression level” at the top with a setting of 9 although it won’t compress the images nearly as much as OptiPNG.
For WebP, choose WebP from the dropdown. Press Options and enable Lossless compression with a Quality of 100. Also, set the Compression method to 6 as it may shave off a few KB from larger images. Then start the conversion.
7. cWebP (WebP)
This is the official WebP compression tool from Google and the suite contains tools to encode, decode, analyze, mux, and compare WebP images among other things. cWebP is the encoding tool to use. As mentioned earlier, WebP can have compressed images using lossy or lossless methods, so we need to tell cWebP to use lossless compression.
cWebP maximum compression command:
cwebp -z 9 image.png -o outfile.webp
There is another lossless compression command although this one can sometimes produce slightly larger file sizes:
cWebP -lossless -q 100 image.png -o outfile.webp
8. OxiPNG (PNG)
This is another open source cross platform PNG compressor for the command line. Unlike some other tools listed here, OxiPNG is actually relatively up to date and the last update at the time of writing was in 2021. OxiPNG is also the main PNG compression method in the Google Team’s online image compressor, Squoosh.
Although OxiPNG has compression settings going from 1 to the maximum of 6, the developer says going past 4 is unlikely to yield any better results. The setting of 4 has also been deprecated in a recent version, so the recommended maximum compression setting should nowadays be 3.
OxiPNG Maxiumum compression command:
OxiPNG -o 3 image.png
9. PngOptimizerCL and PngOptimizer (PNG)
These tools are essentially the same, it’s just one is built with a graphical user interface while the other works from the command line. They will both produce the same results. All you have to do with PngOptimizer GUI version is drag the images to compress them onto the program’s window. By default, it will create a backup of the original file but there are a few settings where it can be turned off.
The CL version runs from Command Prompt or batch scripts. You can either specify the exact file name to optimize or can even use the asterisk character as a wildcard. Both versions support input image formats GIF, BMP, and TGA as well as PNG. The settings in the GUI version are duplicated here as additional arguments.
PngOptimizerCL.exe [-BackupOldPngFiles] file.png
10. FastStone Photo Resizer and FastStone Image Viewer (PNG)
Both of these FastStone tools can compress PNG images using lossless and lossy compression. Photo Resizer is a batch editor and renamer where Image Viewer is just that and more of a general image viewing program. We’ll look at Photo Resizer although Image Viewer can compress the image using the extra options while saving the image file.
Use the internal file browser to locate your file(s), then click Add to put them into the Input list on the right. Select PNG as the output format from the dropdown, luckily, the maximum lossless compression method is used as the default. Use any additional output or rename options and then press Convert. Both programs will output the same file size when the same settings are used.
11. TruePNG (PNG)
TruePNG only supports PNG files unlike some of the PNG compressors above that can convert from other image formats such as JPG and GIF into PNG if it is able to achieve a smaller file size. There are a number of options you can play with but a simple “/o max” or “/o4” argument will try to produce the best compression.
TruePNG maximum compression command:
TruePNG.exe input.png /o max [or /o4]