I tried this hunk of code out at one time and the results are what you are looking for. The problem is that this particular script translates each pixel into a colored ascii character. You would want to use Image::Magick to reduce the resolution of the picture to manageable dimensions for representation as ascii in an html page (so that you have a picture that fits into a browser window).