in reply to control palette with Imager

What are the contents of @colors in your sample code? If it contains just two Imager::Color objects which represent the two high-saturation colors that you want to preserve then Imager should do what you require, i.e. the other ten colors will be filled in by the module.