http://tinypng.org/ is a great service, they optimized my png images by ~67%. How does their service work? How can they minimize size and quality of pictures still remains the same?
-
1There are close votes on this question. I was thinking of casting a vote, but it's really hard to justify that when all of the votes are for different reasons. Personally, I think it's off topic. It's not not a real question. There are 2 very real questions.– WugCommented Aug 27, 2012 at 17:49
-
2PNG is lossless. There are existing tools for optimized compression. Should your overly broad question be about the algorithm or format, then there's also the PNG spec– marioCommented Aug 27, 2012 at 17:52
1 Answer
The answer's right on that web page:
When you upload a PNG (Portable Network Graphics) file, similar colours in your image are combined. This technique is called “quantisation”. Because the number of colours is reduced, 24-bit PNG files can be converted to much smaller 8-bit indexed colour images. All unnecessary metadata is stripped too. The result: tiny 8-bit PNG files with 100% support for transparency. Have your cake and eat it too!
It turns 24-bit RGB files into palettized 8-bit ones. You lose some color depth, but for small images it's often imperceptible.
You can do the same thing manually on the command line with this awesome tool: http://pngquant.org/
-
when I tried to execute this exe from command prompt in Windows . it says "'pngquant' is not recognized as an internal or external command, operable program or batch file." do you have any idea on this? Commented Feb 25, 2015 at 22:26
-
1@user270014 - You must be inside directory which actually contains that exe file. Use cd C:\path\to\pngquant– xZeroCommented Mar 22, 2015 at 20:56
-
1
-
1Thank you for the alternative! TinyPNG plus optimization (e.g.
image_optim
) seems to produce the best results, butpngquant
is nice and easy to script.– WilfCommented Mar 20, 2016 at 18:49 -
1I've made a test. Use a 8-bit PNG file 1.2MB, and tinypng compress it into 300K. It seems it's NOT to turn 24-bit RGB file into a 8 bit one Commented Nov 19, 2018 at 14:46