Clearly not aiming for smallest representation though. ;-) https://github.com/discountgenius/pixeltable/blob/master/pix...
First off, the p class should just go on the table instead of every pixel. Then use a descendant combinator "table.p td".
Next, I would probably index the image (like a gif) down to a few hundred colors, create a style for each, and then use a base62 (0-9A-Za-z) representation of the index as a class name.
You can further reduce the content size if you can use ids instead of classes, but even with classes, you don't need the quotes around the class names.
There are probably more ways as well, like using a fixed-width div container and filling it with floating <b> tags instead of using a table.