The underlying idea is to generate the equivalent of an image with gradients and uniform in the RGB spectrum (like https://www.flickr.com/photos/[email protected]/51421529591), while also enforcing the uniqueness of its colours.
Outline of the approach:
- Start with a single area comprising the whole image and all available colours assigned to it.
- Split each area into two equally sized inner and an outer areas, with respect to the centre of the image. Reassign colours with a higher/lower red intensity respectively to the inner/outer area.
- Split each area into two equally sized upper and lower areas. Reassign colours with a higher/lower green intensity respectively to the upper/lower area.
- Split each area into two equally sized left and right areas. Reassign colours with a higher/lower blue intensity respectively to the right/left area.
- Repeat from 2. until all areas are reduced to a pixel with a unique colour assigned to it.