• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Really good PNG optimization programs?

Joined
Oct 2, 2004
Messages
13,871 (1.84/day)
System Name Dark Monolith
Processor AMD Ryzen 7 5800X3D
Motherboard ASUS Strix X570-E
Cooling Arctic Cooling Freezer II 240mm + 2x SilentWings 3 120mm
Memory 64 GB G.Skill Ripjaws V Black 3600 MHz
Video Card(s) XFX Radeon RX 9070 XT Mercury OC Magnetic Air
Storage Seagate Firecuda 530 4 TB SSD + Samsung 850 Pro 2 TB SSD + Seagate Barracuda 8 TB HDD
Display(s) ASUS ROG Swift PG27AQDM 240Hz OLED
Case Silverstone Kublai KL-07
Audio Device(s) Sound Blaster AE-9 MUSES Edition + Altec Lansing MX5021 2.1 Nichicon Gold
Power Supply BeQuiet DarkPower 11 Pro 750W
Mouse Logitech G502 Proteus Spectrum
Keyboard UVI Pride MechaOptical
Software Windows 11 Pro
I've recently done a test on PNG optimizers after I've had to make my avatar smaller for some forum, but couldn't find any good PNG optimizer. Until I've tested 3 online ones that delivered mind blowing results.

Article + test of several PNG optimizers:
https://rejzor.wordpress.com/2016/01/08/make-png-images-up-to-50-smaller/

Few of my readers asked for standalone optimizers, you know, desktop programs that you can use at any time without depending on internet connection and those websites.

Are there any such programs in existence that can deliver same size and quality as the online ones? If you do know any, please let me know here or on my blog (no registration needed). Thx
 
PNG is lossless, if you need a smaller size, just use JPG and adjust the compression. hold on to your PNG so you have a lossless quality version but PNG isn't the way to go if you want a small file.
 
Nice testing. Note how some of the compressors slightly change the colors of the image due to lack of proper color profile support.

We are using similar compression techniques for our new review graphs
 
Give me the original png, to see how far Photoshop CC can go...
 
PNG is lossless, if you need a smaller size, just use JPG and adjust the compression. hold on to your PNG so you have a lossless quality version but PNG isn't the way to go if you want a small file.

PNG can be lossy as well when you decrease number of colors. JPG is not an option because it doesn't support alpha transparency. GIF only comes in 256 colors and has no alpha transparency.

After inspecting the online optimized files, they seem to be 8bit (256 colors) while retaining alpha transparency. I don't know how that is possible, but they are somehow doing it. That's why size is the same as 8bit PNG but with alpha transparent edges that look like on lossless 32bit PNG's.

Nice testing. Note how some of the compressors slightly change the colors of the image due to lack of proper color profile support.

We are using similar compression techniques for our new review graphs

Hammering down palette is not as much an issue as it is maintaining alpha transparency on the edges. Are you doing the same thing with your image optimization, I mean, do you get same results as the best 3 ones in my test?

Give me the original png, to see how far Photoshop CC can go...

Here you go:

ORIGINAL_80x80.png


Please take a screenshot (so I can see what settings you've used exactly) and upload here my version optimized with Photoshop so I can add it to my test. Having Photoshop there would be nice as well since it's a professional tool. I only use Paint.NET which for a free Photoshop alternative delivered by far the best results. Second best in fact compared to 3 online optimizers which were pretty much the same. Edges are a bit rough, but they look way better than RIOT or PngOptimizer.
Thx for testing this for me.
 
Greenfish Icon Editor Pro made it about 300 bytes larger (8411 bytes) so...nope.

GIF Movie Gear reduced it by over half as a PNG (3306 bytes) but in doing so, it clearly lost the gradients in the shadows so it doesn't look as good. As a static GIF, it is 3253 bytes (again, doesn't look great).

Visual Studio 2015 won't save until after you edit so I painted a bit in the corner, erased it, and saved it: 8465 bytes

Note: My GFIE and GIF Movie Gear are old so may not be representative of the latest versions. GFIE's latest version has been invested with adware so recommend avoiding it. The version of GIF Movie Gear I'm using is probably at least a decade old...never tried newer.
 
Last edited:
Here it is:
Photoshop CC 2015 with save as/export as png8/export as png24 + gimp export as...all are on default...
 

Attachments

Thx. The problem is, they all made it either even larger or with bad edges (png8).
 
I decided to screw around with it a bit in gimp. I saved the file, I re-exported it in with minimal extra junk that gets added to PNG files, then as a second test, I altered some of the color and transparency levels.

Original (7.93KB):
ORIGINAL_80x80.png


Re-saved (7.51KB):
MOD_80x80.png


Transparency altered (7.25KB):
MOD_TRANS_80x80.png


Color and transparency altered (7.04KB):
MOD_COLOR_SHIFT_80x80.png


More common colors and less transparent space is going to save you space without using PNG8, this is because DEFLATE is good at compressing repetitive data so similar colors is going to result in a better compression ratio. All in all PNG is still lossless, what you do with PNG before saving it again though, is not.

Personally, if you have the eye for what you want, I would try altering the colors in something like GIMP so the image looks acceptable while cutting out some color that doesn't make a huge impact but is still represented enough on the image to worsen compression. It's a matter of modifying the image so it compresses better but, PNG is still lossless.
 
I think that last one @Aquinus posted is about the best you're going to get with PNG, especially considering the fact it makes an excellent candidate to convert to GIF:
test.gif

2.94 KB (3,020 bytes)
 
Last edited:
Not when you can have this at basically the same size...
W4_SheepScarf 80x80 crop_COMPRESSED.png

3.22 KB (3.298 bytes)

The online optimizers witchcraft...
 
Not witchcraft: https://www.w3.org/TR/PNG/

bytes-tell-no-lie.png


IHDR (header)
80 wide
80 high
8 bit depth
3 color type: "Indexed-color: Each pixel is a palette index; a PLTE chunk shall appear."
0 compression method: zlib
0 filter method
0 interlace method

PLTE (palette)
687 bytes / 3 (8 bits per color) = 229 colors in the palette

tRNS (transparency)
87 bytes / 1 (8 bits per alpha) = 87 alphas describing the first 87 colors in the palette

This is why PNG beats GIF: GIF only does one color for alpha--it doesn't do per color alpha transparency.

The code used to generate this image did an excellent job at deciding what palette colors to use and translating similar colors to the decided upon palette. Visual Studio 2015, by comparison, does a horrible job at selecting colors.
 
Last edited:
Yeah, but why NOT A SINGLE desktop app program achieves such results, just the online optimizers? That's why I call it a witchcraft, because not even Photoshop which is a super expensive app can't achieve that. One would expect at least that one to do the same.

I'm already well aware how PNG is better than GIF. What I don't understand is how online optimizers achieve such tiny sizes without dropping quality or ruining alpha edges while still using PNG format. I mean, it still has to be within specifications, otherwise browsers and image viewers would have problems. No such issues.
 
Hammering down palette
The color changes are not due to palette reduction but due to fail @ embedded color profiles (like sRGB, monitor RGB etc). Also varies from browser to browser (displaying teh same PNG)
 
Yeah, but why NOT A SINGLE desktop app program achieves such results, just the online optimizers? That's why I call it a witchcraft, because not even Photoshop which is a super expensive app can't achieve that. One would expect at least that one to do the same.

I'm already well aware how PNG is better than GIF. What I don't understand is how online optimizers achieve such tiny sizes without dropping quality or ruining alpha edges while still using PNG format. I mean, it still has to be within specifications, otherwise browsers and image viewers would have problems. No such issues.
Because use of the palette feature of PNG is...rare...so the code written to optimize it is poor. That website clearly wrote their own algorithm for palletizing an image and it's much improved from what everyone else is using.


Let me put it this way: Photoshop, Visual Studio, etc. are all creation programs, not conversion programs. If you were creating an image and you know you're only going to use 129-256 colors, you'd set it to palette format then work inside of those constraints. These programs aren't designed from the philosophy of taking an existing image and palletizing it. They do it as a function of selecting a palette option on an existing image but they do it poorly because that is not their original design purpose. The web optimizer, on the other hand, that is exactly its purpose.
 
Last edited:
Made an account to say thank you RejZoR for the comparison, and everyone else for all the tests. I have been using FileOptimizer for a long time now and the size it got was 7.21 KB. Even if there is a logical explaination how the online sites do it.. it does feel liek witchcraft..
 

Attachments

  • ORIGINAL_80x80_FileOptimizer.png
    ORIGINAL_80x80_FileOptimizer.png
    7.2 KB · Views: 564
Because use of the palette feature of PNG is...rare...so the code written to optimize it is poor. That website clearly wrote their own algorithm for palletizing an image and it's much improved from what everyone else is using.


Let me put it this way: Photoshop, Visual Studio, etc. are all creation programs, not conversion programs. If you were creating an image and you know you're only going to use 129-256 colors, you'd set it to palette format then work inside of those constraints. These programs aren't designed from the philosophy of taking an existing image and palletizing it. They do it as a function of selecting a palette option on an existing image but they do it poorly because that is not their original design purpose. The web optimizer, on the other hand, that is exactly its purpose.

Sorry but I have to call BS on that one. Photoshop is a professional tool that costs how much? 300€ a year? And it can't optimize PNG's to the same level free online service does. It's a professional tool, it HAS to be able to shrink PNG's to the same level free stuff does. It doesn't matter if you're creating or converting. Besides, I've also tested several apps which specialize at nothing but conversion and shrinking of GIF's and PNG's. And none of them achieves such size reduction. That's the part I don't understand.
 
Made an account to say thank you RejZoR for the comparison, and everyone else for all the tests. I have been using FileOptimizer for a long time now and the size it got was 7.21 KB. Even if there is a logical explaination how the online sites do it.. it does feel liek witchcraft..

Hey, that's a really nice tool. It can optimize crap ton of file formats without decreasing quality (lossless). Even stuff like MP3. Amazing. Just tested with some MP3 (1 hour long mix) and it decreased size from 142MB to 129MB. That's pretty significant considering it hasn't decreased quality at all. I have to feature this on my blog for sure!
 
Sorry but I have to call BS on that one. Photoshop is a professional tool that costs how much? 300€ a year? And it can't optimize PNG's to the same level free online service does. It's a professional tool, it HAS to be able to shrink PNG's to the same level free stuff does. It doesn't matter if you're creating or converting. Besides, I've also tested several apps which specialize at nothing but conversion and shrinking of GIF's and PNG's. And none of them achieves such size reduction. That's the part I don't understand.
If you want to complain to Adobe about lackluster 256-color PNG support, go right ahead.

I explained how it is done. My guess is 99% of the programs out there that support PNG have adapted the open source libpng code which only has rudimentary support for converting ARGB to palette. The online converter you used clearly doesn't use libpng; they use something they coded themselves to fix libpng's shortcoming in palettizing ARGB. What it is doing is 100% part of the PNG specification; it's just an area that is neglected by most developers because converting to palette is often lossy.


I highly doubt FileOptimizer will convert ARGB to palette. I suspect it reduces file size by cleaning up residual data in files. Using PNG as an example, instead of specifying 229 colors, it could have specified all 256 colors where the last 29 colors (87 bytes) are all nulls. The FileOptimizer could eliminate those unused color indices reducing the size of the file by 87 bytes with no loss of data.

Additionally, a lot of formats support zlib compression (including PNG) but they use the method for fastest compression rather than smallest. Simply unpacking the data and repacking it using the highest compression setting can substantially reduce the size of the file.
 
Last edited:
Hey, that's a really nice tool. It can optimize crap ton of file formats without decreasing quality (lossless). Even stuff like MP3. Amazing. Just tested with some MP3 (1 hour long mix) and it decreased size from 142MB to 129MB. That's pretty significant considering it hasn't decreased quality at all. I have to feature this on my blog for sure!
It depends on how the MP3 is encoded. Something like LZMA2 is bound to compress MP3s a little bit but, you probably won't see that with formats like FLAC. All in all, MP3 is an old standard and I wouldn't exactly say it squeezes the most space for what it is. Honestly, MP3 is a standard that needs to go the way of the dinosaur in my opinion.
 
If you want to complain to Adobe about lackluster 256-color PNG support, go right ahead.

I explained how it is done. My guess is 99% of the programs out there that support PNG have adapted the open source libpng code which only has rudimentary support for converting ARGB to palette. The online converter you used clearly doesn't use libpng; they use something they coded themselves to fix libpng's shortcoming in palettizing ARGB. What it is doing is 100% part of the PNG specification; it's just an area that is neglected by most developers because converting to palette is often lossy.


I highly doubt FileOptimizer will convert ARGB to palette. I suspect it reduces file size by cleaning up residual data in files. Using PNG as an example, instead of specifying 229 colors, it could have specified all 256 colors where the last 29 colors (87 bytes) are all nulls. The FileOptimizer could eliminate those unused color indices reducing the size of the file by 87 bytes with no loss of data.

Additionally, a lot of formats support zlib compression (including PNG) but they use the method for fastest compression rather than smallest. Simply unpacking the data and repacking it using the highest compression setting can substantially reduce the size of the file.

You're missing a bigger picture here. No PNG optimizer claims it's 100% lossless only. They do offer lossy optimizations. So, why not a single stand alone does that? I don't care what they convert, I just want the results. And none deliver them.

It depends on how the MP3 is encoded. Something like LZMA2 is bound to compress MP3s a little bit but, you probably won't see that with formats like FLAC. All in all, MP3 is an old standard and I wouldn't exactly say it squeezes the most space for what it is. Honestly, MP3 is a standard that needs to go the way of the dinosaur in my opinion.

FileOptimizer isn't compressing it with separate algorithm like LZMA2. It's using MP3Packer which restructures MP3 content in such a way that it can reduce file size without losing any data. Whole program is designed this way. Lossless optimization of various file types. I've also briefly tested JPEG images and it generally reduced size of them by 20%. Which is pretty decent if your image library is huge... Anyway, going a bit offtopic now, but I really like the way how this app works :D
 
Just make sure to point out that when someone wants to use that, they should take a look at the settings. I think PNG starts by default with the option of lossy PNG. Afar from that I too have used it for many things. For the compressed files it says it works, it does, but I am using Freearc if I was high compressed stuff, so I never really use that feature. If anything it is updated frequently and it seems to work nicely for me. Sadly I do not know like you guys how things work, but I am glad at least I pointed out someone useful. Still thanks a lot for the review and the sites. This is really helpful.
 
Yeah, but why NOT A SINGLE desktop app program achieves such results, just the online optimizers? That's why I call it a witchcraft, because not even Photoshop which is a super expensive app can't achieve that. One would expect at least that one to do the same.

I'm already well aware how PNG is better than GIF. What I don't understand is how online optimizers achieve such tiny sizes without dropping quality or ruining alpha edges while still using PNG format. I mean, it still has to be within specifications, otherwise browsers and image viewers would have problems. No such issues.

Do you really want to know or just going to keep ranting? Ford explained how it's done in the post you're replying to. There is no question left to how it's being done.

The second part is don't blame the tool if you don't know how to use it:

ps-sheep-comparison.png
 

Attachments

  • ORIGINAL_80x80_PS.png
    ORIGINAL_80x80_PS.png
    3.6 KB · Views: 482
Tried enabling lossy PNG optimization in FileOptimizer and this is the result...
FileOptimizer_Lossy.png


File size is around 3.2 KB and by looking this thing in a browser, I think we have a winner. Small file size and really nice looking edges.

I'll update my review with this one addition. Hooray, we found at least 1 desktop app that achives similar results as those online optimizers. :D
 
@Jizzler
No need to be bitchy. I don't own Photoshop and some user above optimized it with Photoshop. He made almost zero reduction so that's what I went with. I haven't received any details on settings used for that.

Can you provide screenshot of settings used in PS so I can write that down next to the sample on my blog? Thx. Clearly you had to use some other settings to achieve this...
 
Back
Top