lossypng
lossypng copied to clipboard
Library version of the lossypng command line tool by @foobaz
Warning: This library should probably not be used just yet
lossypng
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
The optimized images were encoded to PNG using a png.Encoder{png.BestCompression}
Optimize(m, RGBAConversion, 10) 156 KB
Optimize(m, GrayscaleConversion, 10) 40 KB
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.