The Brick Painter is a little web application that converts any image you feed into it (within reason) into blocks. Specify the height or width in blocks, choose the colour set, and it generates the brickified image for you.
It then tells you which colours of bricks are needed to build the image, and in which quantities. This allows you to then (if you are crazy enough) build it after ordering the relevant bricks (if you don’t have them in stock).
The Brick Painter is also released under a BY-NC-SA Creative Commons licence, so if you are into coding you can download the entire package here and improve it as you please. Hopefully the minimal comments in the code help.
Update: read more on the build process on the follow-up post, Brick Painting: build your own LEGO-based reproductions.