How to convert PNG as tinypng.com does?

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: helmut, XnTriq, xnview

Post Reply
cy66a
Posts: 2
Joined: Fri Aug 04, 2023 7:28 pm

How to convert PNG as tinypng.com does?

Post by cy66a »

Hi, guys!

I noticed that when I convert PNG images, they are much larger than when I do it with tinypng.com service.

I tried different combinations of compression ratio and filters, but nothing helps. :D

Can you help me to create a profile or just tell me settings combination in order to achieve the same result as tinypng.com?

Best regards!
cday
XnThusiast
Posts: 4394
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: How to convert PNG as tinypng.com does?

Post by cday »

Could you either post example tinypng.com and XnConvert images, or use XnView MP (for example) to examine the differences in the properties of the images. Maybe the colour depths are different??

Or if easier maybe post an original image for examination.
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How to convert PNG as tinypng.com does?

Post by XnTriq »

TinyPNG's compression is lossy. According to XnView (ImageCount colors used), example-orig.png has 14'983 unique colors, while example-shrunk.png has only 236. Inspecting these examples with TweakPNG shows that the color depth has been reduced from truecolor + alpha channel to indexed + alpha channel. So-called “ancillary chunks” (e.g. metadata) have also been removed.

Because I use Pngyu/PNGoo (for lossy color reduction) and PngOptimizer (for lossless compression), I put buttons to these programs on XnView's toolbar.

https://www.tinypng.com/images/example-orig.png
https://www.tinypng.com/images/example-orig.png
example-orig.png (55.57 KiB) Viewed 25745 times
https://www.tinypng.com/images/example-shrunk.png
https://www.tinypng.com/images/example-shrunk.png
example-shrunk.png (15.03 KiB) Viewed 25745 times
example-orig.png compressed with PngOptimizer
example-orig.png compressed with PngOptimizer
png-optimizer.png (50.4 KiB) Viewed 25745 times
example-orig.png compressed with Pngyu (256 colors)
example-orig.png compressed with Pngyu (256 colors)
pngynu.png (16.3 KiB) Viewed 25745 times
example-orig.png compressed with Pngyu (256 colors) and PngOptimizer
example-orig.png compressed with Pngyu (256 colors) and PngOptimizer
pngynu+png-optimizer.png (14.93 KiB) Viewed 25745 times
cy66a
Posts: 2
Joined: Fri Aug 04, 2023 7:28 pm

Re: How to convert PNG as tinypng.com does?

Post by cy66a »

Many thanks!
Post Reply