DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit e73e19e0251e2bf8a4707ea1f33239f6db35e0c4
parent 4661d1461ea092da06c7fada279cd3405de473c2
Author: JP Cimalando <jp-dev@inbox.ru>
Date:   Fri,  8 Feb 2019 14:12:06 +0100

png2rgba: Support palette-based PNG files (#128)


Diffstat:
Mutils/png2rgba.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/utils/png2rgba.py b/utils/png2rgba.py @@ -52,7 +52,10 @@ def png2rgba(namespace, filenames): shortFilename = filename.rsplit(os.sep, 1)[-1].split(".", 1)[0] shortFilename = shortFilename.replace("-", "_") - png = Image.open(filename) + png = Image.open(filename) + if png.getpalette(): + png = png.convert() + pngNumpy = numpy.array(png) pngData = pngNumpy.tolist() #pngData.reverse()