Skip to content

Commit

Permalink
extracticn.py: calculate color palette usage
Browse files Browse the repository at this point in the history
  • Loading branch information
miniupnp committed May 5, 2018
1 parent 571a44a commit fdb96c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/extracticn.py
Expand Up @@ -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]
Expand Down

0 comments on commit fdb96c7

Please sign in to comment.