#!/usr/bin/env python3
from pzr_utils import *

#construct dict of chars to colors
legend_dict = get_legend_dict()

#print the level
level_file = levels_dir+sys.argv[1]
pix, w, h, col_set = pixels_whc(level_file)
line = ""
print()
for j in range(h):
  line = ""
  for i in range(w):
    r, g, b, a, hcolor = rgbah(pix,i,j)
    if (a == 0):
      line += "."
      continue
    line += legend_dict[hcolor.lower()]       
  print (line)
print ()
