DPF

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

commit 18e4533b4772ac7ffd35e4a2ca68603bdc116803
parent d9f3c75d20f50b11079b1a7db88acab9089779db
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()