Closed minodisk closed 9 years ago
using image at #31 (comment).
func main() {
resp, err := http.Get("https://cloud.githubusercontent.com/assets/574362/7743940/9c3608e0-ff9f-11e4-84f2-b7b6f3e109d0.png")
if err != nil {
panic(err)
}
defer resp.Body.Close()
src, err := png.Decode(resp.Body)
if err != nil {
panic(err)
}
size := src.Bounds().Size().Mul(2)
dst := Resize(uint(size.X), uint(size.Y), src, Lanczos3)
file, err := os.Create("dist.png")
if err != nil {
panic(err)
}
if err := png.Encode(file, dst); err != nil {
panic(err)
}
}
fail :sob:
success :smile:
Thanks for the pull request!
When resize
image.RGBA
, output image is very white. This problem is maybe related to https://github.com/nfnt/resize/issues/31#issuecomment-104170311.In the premultiplication in
resizeRGBA
, color shouldn't be divided by0xffff
but0xff
, because the color ofcolor.RGBA
isuint8
, IMO.