update
karlmikko opened this issue · 2 comments
func getWidthAndHeight(img image.Image) (width, height int) {
width = img.Bounds().Max.X - img.Bounds().Min.X
height = img.Bounds().Max.Y - img.Bounds().Min.Y
return
}
you should use the Dx() for the width and Dy() for the height
func getWidthAndHeight(img image.Image) (width, height int) {
width = img.Bounds().Dx()
height = img.Bounds().Dy()
return
}
Yeah, I was using Bounds.Min.X and family cause at first (and in the end) that function was supposed to check that the top layer (source) fits into the bottom layer (destination), they don't have to be the same size. But for utility purposes i just changed the name of the function to test blend modes. It is still a work in progress and when I finish correcting issues on the blend modes I will refactor the image wrappers and probably the function will dissapear.
I will let the issue stay open as a reminder.