How to convert PNG as tinypng.com does?

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

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: 4022
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: 6350
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.

example-orig.png
example-shrunk.png
png-optimizer.png
pngynu.png
pngynu+png-optimizer.png
You do not have the required permissions to view the files attached to this post.
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!