Skip to content

Latest commit

 

History

History
44 lines (24 loc) · 1.33 KB

README.md

File metadata and controls

44 lines (24 loc) · 1.33 KB

Warning: This library should probably not be used just yet

lossypng

GoDoc

Library version of the lossypng command line tool.

Shrink PNG files by applying a lossy filter

Installation

go get -u github.com/peterhellberg/lossypng

Feel free to copy all or parts of this package into your own codebase.

Examples

Original image 320 KB

Original image

The optimized images were encoded to PNG using a png.Encoder{png.BestCompression}

Optimize(m, RGBAConversion, 10) 156 KB

Optimize(m, RGBAConversion, 10)

Optimize(m, GrayscaleConversion, 10) 40 KB

Optimize(m, GrayscaleConversion, 10)

Credit

This compression technique was invented by Michael Vinther for his excellent Windows program, Image Analyzer. It does much more than just compression. It was ported and improved by William MacKay.

I have just converted it into a library.

License

All code in lossypng is public domain. You may use it however you wish.