I'm trying to design an art print that uses overprinting to create color variations, and I want to use as few component colors as possible. Given a design, is there a way to figure out the smallest set of colors that can be overprinted to reproduce the intended colors?

For example, if given this design as a raster image:

[![design colors](https://i.stack.imgur.com/qEaXL.png)](https://i.stack.imgur.com/qEaXL.png)

How could you figure out that the colors can be made by overprinting these component colors?

[![components](https://i.stack.imgur.com/lZt5E.png)](https://i.stack.imgur.com/lZt5E.png)

In this example, I just made the design by combining different combinations of the components.

[![enter image description here](https://i.stack.imgur.com/lKLMX.png)](https://i.stack.imgur.com/lKLMX.png)

Note that the first component color doesn't appear on its own in the design, and is only an underlying part of the design.

This seems similar to CMYK separation, but with different component colors. And, there could be any number of underlying components. (Not just the standard four, like CMYK.)

Is there a known programmatic method to find the smallest set of components for a given set of colors? (Not trial and error.)