Custom Palette

Hi,
Trying to create a specific effect.

How would you create a custom palette from an image loaded in COPs?