Closed disintegration closed 9 years ago
Hi, I believe pixel position calculation isn't quite correct. Here's a demo:
package main import ( "image" "image/png" "os" "github.com/nfnt/resize" ) func main() { checkers := image.NewGray(image.Rect(0, 0, 4, 4)) checkers.Pix = []uint8{ 255, 0, 255, 0, 0, 255, 0, 255, 255, 0, 255, 0, 0, 255, 0, 255, } dst := resize.Resize(100, 100, checkers, resize.NearestNeighbor) SaveImage(dst, "test.png") } func SaveImage(img image.Image, f string) { out, err := os.Create(f) if err != nil { panic(err) } defer out.Close() png.Encode(out, img) }
Expected result:
Actual result:
The proposed change fixes the issue.
Thanks for the bug fix!
Hi, I believe pixel position calculation isn't quite correct. Here's a demo:
Expected result:
Actual result:
The proposed change fixes the issue.