News for hackers. Stuff that matters.
Re:Writing code with MS Paint by mrcharles on Wednesday April 06, 2011 @09:44AM (#2415040)
So, I was bored after seeing this last week when I submitted it to HN, and so I whipped up a quick python script to shove code in to a BMP file. I bashed it out quick and didn't bother cleaning it up, but here it is:

https://github.com/mrcharles/codemap

Output from image.py: http://www.bluh.org/codemap.bmp

Sadly there's still a bug, I think it has to do with alignment padding, which causes a null byte every 520 characters. When I get bored I'll fix it.

I think I'm going to write code though to try and make "pretty" images from source code, though in the end it won't be human readable when you open the file.

Re:Writing code with MS Paint by lloeki on Wednesday April 06, 2011 @11:49AM (#2415539)
Make the image width a multiple of four? (thanks to this comment http://news.ycombinator.com/item?id=2415202)
Re:Writing code with MS Paint by mrcharles on Wednesday April 06, 2011 @12:26PM (#2415741)
Yeah, I know that's the fix, I'm just too lazy to do it. When I belted it out I forgot to think about that and then I didn't notice the nulls until someone pointed them out. Oops.