"""
1) First I open or generate image in GIMP
2) next I go to Image->Mode->Indexed and set the image to single bit color
3) Now I export it as a .c file (which exports it as a glib graphic) and turn off alpha channel in the export
4) I edit the c file so the data is stored in a global array named "data"
5) I added this to the end of the c file (updating 44 and 46 as appropriate for new width and height)
int main()
{
    int x_index = 0;
    int y_index = 0;
    char * data_ptr = data;
    printf("0b");
    while(y_index<44)
    {
        if(data_ptr[0] == 0 && data_ptr[1] == 0 && data_ptr[2] == 0)
        {
            printf("00");
        } else
        {
            printf("11");
        }
        data_ptr +=3;
        x_index++;
        if(x_index==46){
            printf("\n0b");
            x_index = 0;
            y_index++;
        }
    }
}


6) compile and run, then output to >bitmap
7) run the python script to get a file I can import into the rom 
"""

f = open("bitmap","r")
text = f.read();
f.close()

output = ""

output = ""
for line in text.split("\n"):
    if (line == "" or line == "0b"):
        break
    val = eval(line)
    line = "{:02x}".format(val)
    print(line)
    output += line
#while index < len(output):
#    print(output[index:index+width])
#    index += width;

