Since the bitmap is just a header (the mojibake you see at the start of the text file) and then a bunch of data bytes, the data bytes can be read as plain text again.
He is filling in the image from left-to-right, bottom-to-top. That's the scanline order of the data in BMP files, which means he is entering the code in the order it appears in the file.
Also, the image he is filling in is eight pixels wide. This is important because the row data in BMP files must be padded to a multiple of four bytes. Each pixel in a 24-bit image takes three bytes. If he had picked a width that wasn't a multiple of four, he would have had garbage padding bytes in the middle of his code.
By selecting the colors for individual pixels that correspond to the ASCII characters in the source code, a BMP is created that contains the source code.
This seems completely useless, until you realize that early computers were programmed by flipping switches to enter the binary values the operator wanted to set...
Then you realize that this is entering human-readable high-level language code that would have to be compiled, and with a header that will fail to compile, so yes, this is completely useless. grin
I wonder if this works in reverse. Maybe we can program the Mona Lisa in C.
In a world where it is possible to compute a file that contains its own MD5, I wouldn't bet on this. Wish I could find the link, there was some feted programmer who had a friend that bet him such a thing was not possible. He proceeded to write an algorithm that found such a file by brute force.
I wouldn't count on the eventual C being pretty though.
See also: electronic musicians hiding pictures in their music http://www.bastwood.com/?page_id=10
[1] http://java.sun.com/docs/books/jls/second_edition/html/lexic...
http://www.bluh.org/codemap.bmp
Ultimately it's never going to be pretty if it's human readable as the range of bytes used will make a lot of greyish tones.
C/C++ wouldn't look a lot different I doubt, but if you want you can grab my python script (PIL required) and pack some source files and see for yourself:
http://www.github.com/mrcharles/codemap
(script has some bugs with alignment, but other than that, works)