Closed wzhsh90 closed 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.
ok , I will try later , thanks.
Hi:
I tried your method ,this method can not work well, the narrow picture's size is bigger than origin.
just like tinypng compress the picture