
this is a crop of a full 4096x4096 image containing 1 pixel of each SRGB color. the process goes as follows:
1. each color is generated in a list, shuffled, then sorted by some metric. (this one is sorted descending by the v metric in CIE 1976 L*u*v* colorspace)
2. the first color is placed in 1 pixel somewhere on the empty canvas. in this case, the center (which is cropped out) 3. for each successive color, it is placed in the empty pixel in the frontier with the exactly closest matching color
3a. the frontier is the set of still-empty pixels on the canvas that have a non-empty pixel directly next to them in a cardinal direction (up, down, left, right)
3b. the "color" of a frontier pixel is the weighted average* of the colors of the eight pixels around it, where the diagonally adjacent ones are slightly lower weighted (*averaged in the same color metric space we are using for color similarity)
3c. the closest matching color is the one that has the smallest euclidean distance (channelwise sum of squares) in the color metric we are using. the colorspace of the output image (and therefore the colors that are present in the image) are the 2^24 colors in SRGB, and they are translated to CIE 1976 L*a*b* for comparison here. (available metrics in the program i wrote are SRGB, linear RGB, CIE 1931 XYZ, CIE 1976 L*a*b*, and CIE 1976 L*u*v*)
3d. this closest-color search is performed using a very fast mutable kd-tree structure i purpose built for this program
this process fills the canvas. with completely randomly sorted colors you get a sort of streaky watercolor-y rainbow radiating from the center; for more regular patterns like full orderings of the RGB space that produce many very similar colors in a row, this results in situations where there are no frontier pixels that are anywhere remotely similar to the color being placed. this makes the placement very expensive because a large swath of the frontier space needs to be searched (kd trees are very efficient but they can't always make nearest-neighbor search fast when the nearest neighbor is very far away). it also happens to make incredibly detailed crystalline frustration patterns that look like cities, non-repeating crenelations, bismuth crystals, striations, or flowers as the frontier becomes incredibly fractalline and large and colors are forced into spaces they clearly don't match. i've found that the more expensive the image was to produce the cooler it generally looks; i've generated ones that take upwards of 45 minutes on a modern processor at tens of millions of comparisons per second (an inexpensive image generation where the colors are randomized and the frontier stays small takes about 22 seconds).