major overhaul

Depending on the image this is up to twice as fast as the old version, usually around one-and-a-half times as fast.
Also moar getters.

Pull it and I'll update our ColorPalette handler. :p