diff --git a/tools/utils/images/convert.go b/tools/utils/images/convert.go index 7ac8f1a83..cf24692d1 100644 --- a/tools/utils/images/convert.go +++ b/tools/utils/images/convert.go @@ -5,7 +5,6 @@ import ( "encoding/binary" "fmt" "image" - "image/color" "io" "os" "slices" @@ -71,18 +70,6 @@ func convert_image(input io.ReadSeeker, output io.Writer, format string) (err er return Encode(output, img, mt) } -func PalettedToNRGBA(paletted *image.Paletted) *image.NRGBA { - bounds := paletted.Bounds() - nrgba := image.NewNRGBA(bounds) - for y := bounds.Min.Y; y < bounds.Max.Y; y++ { - for x := bounds.Min.X; x < bounds.Max.X; x++ { - c := color.NRGBAModel.Convert(paletted.At(x, y)) - nrgba.Set(x, y, c) - } - } - return nrgba -} - func images_equal(img, rimg *ImageData) (err error) { for i := range img.Frames { a, b := img.Frames[i], rimg.Frames[i] diff --git a/tools/utils/images/transforms.go b/tools/utils/images/transforms.go index 5fd5c7ff1..8bf751414 100644 --- a/tools/utils/images/transforms.go +++ b/tools/utils/images/transforms.go @@ -17,7 +17,7 @@ func reverse_row(bytes_per_pixel int, pix []uint8) { for i < j { pi := pix[i : i+bytes_per_pixel : i+bytes_per_pixel] pj := pix[j : j+bytes_per_pixel : j+bytes_per_pixel] - for x := 0; x < bytes_per_pixel; x++ { + for x := range bytes_per_pixel { pi[x], pj[x] = pj[x], pi[x] } i += bytes_per_pixel