Quotient
Quotient

Reputation: 4055

Lossy png compression

What sort of library would be recommended for lossy png compression while retaining alpha layer.

I use kraken.io a lot but would like to work it more into a workflow.

I know a lot about lossless compression but I'm at a loss with how they do lossy.

Upvotes: 6

Views: 4123

Answers (2)

Kornel
Kornel

Reputation: 100110

If you literally want a library, then libimagequant (I think that's what kraken.io uses).

There's also mediancut posterizer that achieves lossy compression by preprocessing. It's much more effective than posterization in Photoshop or ImageMagick.

Description of lossy PNG methods on ImageAlpha website.

Upvotes: 3

leonbloy
leonbloy

Reputation: 75916

PNG is lossless by design, there's no lossy PNG. All you can do is some lossy preprocessing before saving it as PNG, as converting a true colour image to a palette one, or by reducing the number of colors by posterize - all that will probably reduce the size of the image, but that's not part of PNG.

Upvotes: 2

Related Questions