Permalink
Browse files

extracticn.py: calculate color palette usage

  • Loading branch information...
miniupnp committed May 5, 2018
1 parent 571a44a commit fdb96c7368ff7253b64a89176316bdc1d95ac32f
Showing with 4 additions and 0 deletions.
  1. +4 −0 tools/extracticn.py
@@ -118,6 +118,10 @@ def extract_icn(filename, palette = None, icon_map = None):
else:
tileset_width = 4 * width
save_tileset("%s_%02d.pbm" % (filename, i), [tiles[j] for j in icons], width, height, palette, tileset_width)
palette_usage = ['0'] * 256
for c in icn_data['RPAL']:
palette_usage[ord(c)] = '1'
#print ''.join(palette_usage)
if len(sys.argv) <= 1:
print "usage : %s [-p palette.PAL] [-m icon.MAP] file.ICN" % sys.argv[0]

0 comments on commit fdb96c7

Please sign in to comment.