Improved monochrome palette generation. Fixes #4