diff --git a/adafruit_imageload/png.py b/adafruit_imageload/png.py index 89a9ded..010dff3 100644 --- a/adafruit_imageload/png.py +++ b/adafruit_imageload/png.py @@ -168,7 +168,6 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements src += 1 else: raise ValueError("Wrong filter.") - prev, line = line, prev if mode in (0, 4): # grayscale for x in range(width): c = line[x * unit] @@ -180,5 +179,8 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements ) else: raise ValueError("Unsupported color mode.") + + prev, line = line, prev + pal = displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565) return bmp, pal