Reading an image file and converting it to HTML
A choice of compression: Horizontal RLE, Vertical RLE and 2D RLE
Supports image transparency for GIF and PNG images
Some further compression techniques, such as using the most common color as the table
background to avoid repeating it
Choice whether to use CSS styles (better compression but lacks support from some mail clients, including GMail)
Choice of whether to use strict HTML, or loose HTML which takes even less space
Known issues: (if you can fix, please do so on github or discuss the fixes on my blog)
The algorithm used to find squares in 2D RLE is not optimal, and possibly images could be compressed better.
Since compression doesn’t work well for images with too many different pixel colors, I added support for color reduction (quantization) taken from https://gist.github.com/1104622. Many desktop tools have better color reduction, so you might get better quality if you reduce colors on your PC using an image editing program rather than the internal tool.