Removed debugprinting.
This commit is contained in:
parent
2e93bb4702
commit
1e69b994f3
|
@ -10,7 +10,6 @@ def split_seq(seq, splitsize):
|
||||||
newseq = []
|
newseq = []
|
||||||
while seq:
|
while seq:
|
||||||
newseq.append(seq[:splitsize])
|
newseq.append(seq[:splitsize])
|
||||||
print "elem:", newseq[-1]
|
|
||||||
seq = seq[splitsize:]
|
seq = seq[splitsize:]
|
||||||
return newseq
|
return newseq
|
||||||
|
|
||||||
|
@ -30,12 +29,9 @@ if __name__=="__main__":
|
||||||
|
|
||||||
if len(sys.argv) > 3:
|
if len(sys.argv) > 3:
|
||||||
pal_output = open(sys.argv[3], "wb")
|
pal_output = open(sys.argv[3], "wb")
|
||||||
print "entries:", len(im.palette.palette)
|
for color in split_seq(im.palette.palette, 3):
|
||||||
for i, color in enumerate(split_seq(im.palette.palette, 3)):
|
|
||||||
r, g, b = map(lambda col : col >> 3, map(ord, color))
|
r, g, b = map(lambda col : col >> 3, map(ord, color))
|
||||||
|
|
||||||
print "rgb:", r, g, b
|
|
||||||
value = (b << 10) + (g << 5) + r
|
value = (b << 10) + (g << 5) + r
|
||||||
print "color", i, ":", value
|
|
||||||
pal_output.write(struct.pack("<h", value))
|
pal_output.write(struct.pack("<h", value))
|
||||||
|
|
||||||
|
|
Reference in New Issue