Simple solution to get images into a format which can be analysed using GNU/Linux’s text processing wonderland.
/* XPM */ static char *test[] = { /* columns rows colors chars-per-pixel */ "23 33 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ..... ", " ......... ", " ........... ", " ............. ", " ............. ", " ............. ", " ............... ", " ............... ", " ............... ", " ............. ", " ............. ", " ............. ", " .......... ", " ......... ", " ... . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " };