import gameduino.prep as gdprep 
import gameduino.compress
import Image

hh = open("../lena.h", "w")
lena = gdprep.palettize(Image.open("lena.png"), 256)
ir = gdprep.ImageRAM(hh)
ir.addsprites("lena", lena.size, lena)
cd = gameduino.compress.Codec(b_off = 7, b_len = 1)
gdprep.dump(hh, "lenaimg", cd.toarray(ir.used().tostring()))
gdprep.dump(hh, "lenapal", gdprep.getpal(lena))
