diff --git a/picture.go b/picture.go index 2eac45c..00b5070 100644 --- a/picture.go +++ b/picture.go @@ -21,13 +21,8 @@ type Picture struct { // NewPicture creates a new picture from an image.Image. func NewPicture(img image.Image, smooth bool) *Picture { // convert the image to NRGBA format - var nrgba *image.NRGBA - if nrgbaImg, ok := img.(*image.NRGBA); ok { - nrgba = nrgbaImg - } else { - nrgba = image.NewNRGBA(image.Rect(0, 0, img.Bounds().Dx(), img.Bounds().Dy())) - draw.Draw(nrgba, nrgba.Bounds(), img, img.Bounds().Min, draw.Src) - } + nrgba := image.NewNRGBA(image.Rect(0, 0, img.Bounds().Dx(), img.Bounds().Dy())) + draw.Draw(nrgba, nrgba.Bounds(), img, img.Bounds().Min, draw.Src) var texture *pixelgl.Texture mainthread.Call(func() {