Browse Source

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

pull/132/head
JP Cimalando falkTX <falktx@gmail.com> 6 years ago
parent
commit
e73e19e025
Signed by: falkTX <falktx@gmail.com> GPG Key ID: 2D3445A829213837
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      utils/png2rgba.py

+ 4
- 1
utils/png2rgba.py View File

@@ -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()


Loading…
Cancel
Save