A bit of refactoring. Palette generation is now separate from dithering