How can I get better png compression (lower file size) #1599
-
Hi, I have a lot of big png images. When I compress them with tinypng, I got a bit smaller images then compress them with ImageSharp. This is my PngEncoder:
Could you advice anything else, what could I set in options, to get more 10-20% lesser file sizes? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
I'd have to analyze both the input and output from tiny png to compare to give you accurate instruction. If you could post some examples that would be really great. For starters though I would change the filter method to None as that's better for palette based images, also bump that compression. Compression tools tend to remove metadata so I would check that and delete to match also. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@martonx just a sidenote that even if you will be able to find optimal parameters for this particular PNG, there's no guarantee they will be perfect for another one. Tools like tinypng or optipng work on trial and error basis, encoding the image with different parameters until they find the best parameter set for a given PNG. Although you will be probably able to find a good-enough solution with palette encoding, you probably need to accept that there will be always some difference in comparison to those tools if you need a solution that works with an arbitrary PNG. |
Beta Was this translation helpful? Give feedback.
I'd have to analyze both the input and output from tiny png to compare to give you accurate instruction. If you could post some examples that would be really great.
For starters though I would change the filter method to None as that's better for palette based images, also bump that compression.
Compression tools tend to remove metadata so I would check that and delete to match also.