https://github.com/peterhellberg/lossypng
Library version of the lossypng command line tool by @foobaz
https://github.com/peterhellberg/lossypng
go lossy png
Last synced: 10 months ago
JSON representation
Library version of the lossypng command line tool by @foobaz
- Host: GitHub
- URL: https://github.com/peterhellberg/lossypng
- Owner: peterhellberg
- License: unlicense
- Created: 2015-07-15T17:41:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-30T15:49:37.000Z (about 9 years ago)
- Last Synced: 2025-03-25T04:13:26.378Z (11 months ago)
- Topics: go, lossy, png
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 17
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
***Warning: This library should probably not be used just yet***
# lossypng
[](https://godoc.org/github.com/peterhellberg/lossypng)
Library version of the [lossypng](https://github.com/foobaz/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](http://meesoft.logicnet.dk/Analyzer/). It
does much more than just compression. It was ported and improved by
[William MacKay](https://github.com/foobaz/lossypng).
I have just converted it into a library.
## License
All code in lossypng is public domain. You may use it however you wish.