diff --git a/gba/tools/img2bin.py b/gba/tools/img2bin.py index 3d2d79a..9d1575a 100644 --- a/gba/tools/img2bin.py +++ b/gba/tools/img2bin.py @@ -22,6 +22,7 @@ if __name__=="__main__": im = Image.open(sys.argv[1]) output = open(sys.argv[2], "wb") width, height = im.size + print "Converting %dx%d image to binary." % (width, height) for y in range(height): for x in range(width): val = im.getpixel((x, y)) @@ -29,9 +30,9 @@ if __name__=="__main__": if len(sys.argv) > 3: pal_output = open(sys.argv[3], "wb") + print "Converting %d color palette." % (len(im.palette.palette) / 3) for color in split_seq(im.palette.palette, 3): r, g, b = map(lambda col : col >> 3, map(ord, color)) value = (b << 10) + (g << 5) + r pal_output.write(struct.pack("