There are many types of different image formats and some of those most commonly found on the Internet are JPEG, GIF, BMP, TIFF and PNG. Each image format has its own purpose such as GIF is used for animated images, JPEG for high quality photos which automatically gets degraded after each save or even a resize, while our favorite PNG is best used on small and transparent pictures. Another huge advantage in PNG files is they’re lossless meaning you can compress them without losing quality.
You can easily find many tools on the Internet to compress PNG files but most, if not all of them produce different file sizes due to the algorithm unless they are using the same library/technology. Reducing the image file size to the maximum helps to save bandwidth cost, time to download and even achieving a higher Google PageSpeed score because “optimize images” is one of the priorities. In this article we’ve put 12 free PNG compressor tools (online, command line, desktop) to the test to find the one that produces the smallest file size.
Two 8-bit and 24-bit PNG files are compressed using the 12 free image compression tools listed below. The list consists of command line tools, desktop programs and online services. Command line tools are more flexible for automation in batch files but require you to type in the full command including option switches and path. A desktop tool is an easier to use program with a graphical user interface that normally requires a few mouse clicks to work. Finally online services are applications hosted on remote servers where the processing is done on the server and the user doesn’t need to install any third party software.
Command Line Tools
advpng is part of AdvanceCOMP that contains multiple free utilities to recompress PNG, ZIP, MNG and GZ files. advpng hasn’t been updated since 2005 but the compression speed and results will surprise you. Older machines with slower hardware specifications takes slightly longer to process while the newer multi-core CPU takes only a second to produce amazing results.
advpng maximum compression command:
advpng.exe -z4 file.png
OptiPNG is another open source command line PNG compressor that supports Windows and Linux operating system. Both stable and development versions are available to download. Do take note that the maximum command line compression for the stable and development versions are slightly different. The highest level of compression for the OptiPNG stable is -o7 while the development is only -o6. If you try to force -o7 on the development build, you will still get the same file size as -o6.
OptiPNG stable maximum compression command:
optipng.exe -o7 file.png
OptiPNG development maximum compression command:
optipng-hg-latest-win32 -o6 file.png
Pngcrush is also a commandline application that attempts to optimize PNG images by trying out different compression levels and PNG filter methods. If you use the -brute switch, Pngcrush will test the image with 148 methods to find the one that gives the best compression.
Pngcrush maximum compression command:
Pngcrush.exe -brute file.png output.png
PngOptimizer comes with a simple graphical user interface program and all you need to do is drag the images that you want to compress to the program’s window, and also a command line application that runs in command prompt. Other than cleaning up wrong/useless information on PNG to reduce the file size, it can also support animated PNG format (apng) which is still uncommon today. You can either specify the exact file name to optimize or can even use the asterisk character as a wildcard.
PngOptimizerCL maximum compression command:
Unlike most of the command line PNG optimizers, PNGOUT is not open source because the compression algorithm is incorporated into their commercial GUI version called PNGOUTWin that has batch processing and multi-core CPU support. Although it is not open source, you can find pre-compiled binaries for Windows, Linux, BSD and Mac OS X. PNGOUT is one of the easiest to use because by default it uses the highest Xtreme compression algorithm for optimization without specifying an additional command line switch.
PNGOUT maximum compression command:
TruePNG only supports PNG files unlike some of the PNG compressors above that can attempt to convert other image formats such as JPEG and GIF into PNG if it is able to achieve a smaller file size.
TruePNG maximum compression command:
TruePNG.exe input.png /o max
PNGGauntlet is actually a front-end tool that uses 3 different PNG optimizers (PNGOUT, OptiPNG, and DeflOpt) to further compress PNG files instead of normally using just 1. The usage of 3 compressors does increase the time taken to compress the PNG files but definitely yields a smaller file size. A nice feature found in PNGGauntlet is the ability to automatically queue multiple files for batch processing. The default options from the Tools menu are already best (maximum) settings unless you want to preserve the PNG metadata, use grayscale color type and etc. Microsoft .NET Framework 4 is required to run.
Kraken is a free online image optimizer that supports both lossless and lossy optimization mode. You can also either choose the source of image from your computer or paste a list of URLs. The PNG image file is then being “kraked” and uploaded to their CDN for 1 hour temporary storage. The good thing about Kraken.io is they have Chrome and Firefox extension with a limited free API usage. Paid plans for advanced API usage will be released in a few weeks. According to our test, Kraken’s free compression is comparable with the paid PunyPNG’s extreme compression.
pngoptimizer.com is a very simple website that allows you to upload images up to 3MB for compression. Just click the browse button to look for the image file and followed by clicking the Optimize button which is very close to the advertisement block. From the test results, we were able to determine that pngoptimizer.com is using OptiPNG to compress PNG files.
PunyPNG has gotten a lot of attention after a side-by-side comparison of PunyPNG shaving off more bytes than its competitors being posted online. They offer a free compression and if you sign up for a PRO plan, you automatically get the Extreme and Lossy compression. To compress PNG images, click the Upload Images button and you can select up to 15 files with a maximum of 150KB each as a free user. A PRO account gets 50 files with 500KB each.
Smush.it is the most used online optimization tool hosted in the Yahoo Developer network and the functionality is included in YSlow. You can find nearly every application that support Smush.it, for example a WordPress plugin that allows you to easily and even automatically “smush” the images upon uploading to your server. There are 2 methods to compress your images at Smush.it which is either by uploading the files from your computer or specify the URL linking to the images.
TinyPNG only does lossy compression where there will be a slight degrade in quality that can’t be seen by the naked eye to achieve a much smaller file size. So if you have a 24-bit PNG image, compressing it in TinyPNG will become an 8-bit PNG file. It supports 20 images at a time with a generous 3MB each.
PNG Compression Test
Compression results for two 8-bit PNG files
Compression results for two 24-bit PNG files
Summary : For 24-bit PNG files, advpng from the AdvanceCOMP collection wins hands down, producing the smallest 24-bit lossless PNG file size after compression, even beating PunyPNG’s extreme compression that is only available to PRO users.
As for 8-bit PNG images, PNGGauntlet produces the smallest file size followed closely by PNGOUT. Since PNGOUT is able to take the second place, logically PNGGauntlet takes the top spot because it uses a combination of PNGOUT, OptiPNG and DeflOpt which is able to shave off a couple of extra bytes from the PNG files. Do take note that although PNGOUT compresses really well on 8-bit PNG files, it is the worst performing PNG compressor for 24-bit PNG files.
Although unmentioned, we believe the online PNGoptimizer.com service is using OptiPNG on their server to compress PNG files because they produce the exact same size on all 4 tests. Our tests also shows that Kraken Image Optimizer is able to produce the same results as PunyPNG Extreme compression available only to their paid users.
Additional Tip for Command Line Users : If you need to frequently use the command line tools but hate to retype the full command each time you want to optimize and compress PNG files, here is an easy solution that turns typing commands into two mouse clicks. What you can do is add a new action to your context menu that only appears when you right click on PNG files but not on others.
1. Download ExtMan , extract and run the portable executable file.
2. By default the language of the program interface is shown in German, simply click on the US flag icon on the window to switch to English.
3. Scroll down the list and look for the “png” extension with the filetype shown as “PNG Image”.
4. Double click on png extension and click the New action button.
5. You can enter anything on the Process box, preferably either the name of the PNG compressor or simply just Compress if you intend to use only one command line tool.
6. As for the “Applications for this Process” box, you will need to enter the following command line depending on the command line tool that you’re using. Please change the path of the tool if you’re not going to put it in the root of your C:\ drive.
- advpng: C:\advpng.exe -z4 "%1" (Overwrite existing PNG file)
- OptiPNG: C:\optipng.exe -o7 -backup "%1" (Creates a backup of existing file by adding .bak extension)
- Pngcrush: C:\Pngcrush.exe -brute -e _compressed "%1" (Saves the compressed PNG file as original filename + _compressed.png)
- PngOptimizerCL: C:\PngOptimizerCL.exe -BackupOldPngFiles -file:"%1" (Backup original PNG file by adding an underscore character at the beginning of the filename)
- PNGOUT: C:\pngout.exe "%1" out.png (Saves compressed PNG file as out.png)
- TruePNG: C:\TruePNG.exe "%1" /o max /out out.png (Saves compressed PNG file as out.png)
7. Click the Save button to close the Action window and again click the Save button to close the Edit window.
8. Whenever you right click on a PNG file, you will have an extra command at the context menu to compress the file.
via Raymond.CC Blog http://feedproxy.google.com/~r/RaymondccBlog/~3/CVtJb7iOymM/