disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.28k stars 440 forks source link

is there a method to slim picture #76

Closed wzhsh90 closed 6 years ago

wzhsh90 commented 6 years ago

just like tinypng compress the picture

disintegration commented 6 years ago

The Save and Encode functions are just thin wrappers around other packages (image/jpeg, image/png, etc). You can pass additional options to these packages to reduce the output image size. For example:

err = imaging.Save(img, "out.png", imaging.PNGCompressionLevel(png.BestCompression))
err = imaging.Save(img, "out.jpg", imaging.JPEGQuality(50))

The imaging package itself does not provide any other options to reduce image file size.

wzhsh90 commented 6 years ago

ok , I will try later , thanks.

wzhsh90 commented 6 years ago

Hi:

I tried your method ,this method can not work well, the narrow picture's size is bigger than origin.