ppmtohtml: Graphic to HTML Converter
permalinkppmtohtml was a quick utility I whipped up to convert from graphic format to a text-based representation of that format. It works as a filter from PPM format images to HTML output.
For example:
djpeg /tmp/grack-webserver.jpg | pnmscale -xscale 0.25 -yscale 0.25 |
ppmquant 100 | ./ppmtohtml ppmtohtml.cpp > /tmp/test.html
or
giftopnm /tmp/test.gif | pnmscale -xscale 0.25 -yscale 0.25 |
ppmquant 100 | ./ppmtohtml ppmtohtml.cpp > /tmp/test.html
or
pngtopnm /tmp/test.png | pnmscale -xscale 0.25 -yscale 0.25 |
ppmquant 100 | ./ppmtohtml ppmtohtml.cpp > /tmp/test.html
One of my examples was the OpenDVD image. It was transformed into an HTML file containing the DeCSS code. Browsers at the time had difficulty rendering the 100kB of HTML but modern browsers make short work of it.
Sample HTML:
- Download: ppmtohtml-1.0.tgz (original 1999 version)
- Download: ppmtohtml-1.1.tar.bz2 (modernized C++ version)