This page is a work in progress!
Also, there's 87 decks here, so an 8x11 grid leaves one empty, which I fill in with white.
1. Reshape the rectangular array of images/palettes into a 1D array. This makes sorting and arranging things much simpler.
2. Next, define some "score" for each color in the palette for each image.
This could be something as simple (yet effective) as total brightness, R+G+B. Lighter decks get a higher score while darker decks get a lower score.
It could be the difference between the red and blue values, so red decks have high values, whereas blue decks are low. value = R - B. This has the aesthetically pleasing effect of separating red and blue nicely, but it has trouble separating shades of grey, so those get jumbled up in a rather displeasing way.
Or how about a mix of the two, where red and bright are favored, but blue and dark are disfavored? Sort by 4R +G - 4B. This is admittedly not much different than the above, but definitely helps avoid some of the random darker decks from appearing too early. By eye, this is the best way I've come up with to sort the 1D array of decks.
3. Now, gather these scores for all 6 colors in the palette of each image, making sure to scale by the fractional occurrence of that color. Here I use the scoring method from immediately above, score = 4R + G - 4B.
All of the palettes. Each column is a palette, and each row is a color in that palette, with the most common on top.
The scores for each color. Dark pixels (blue, dark decks) have low scores while light pixels (red, white decks) have higher scores.
The scaled scores for each color. Recall that the top pixels are more prevalent in the image, and are weighted more heavily.
4. Combine the scores for each column (i.e. each deck) and sort from highest scores (redder, brighter decks) to lower scores (bluer, darker decks). The result? Hard to see much detail, but it clearly trends from red + bright on the left to blue + dark on the right. Sure, there are some decks with a generally red color scheme towards the right side, but they're dominated by darker colors and are thus suitable there.
5. Finally, I need to reshape this 1D array into some 2D array whose size is basically arbitrary (though I'll choose 15 columns like further above). Traditional ways of reshaping 1D arrays wouldn't exactly order things the way I want; it would basically be sliced into chunks and stacked on top of one another. See the figure on the left. I want to more carefully order the images, essentially in diagonals, like the order shown on the right.
It's pretty quick. For 87 images it takes a minute or two do everything, including reading and downsampling the images, extracting the color palettes via K-Means, scoring, sorting, and reshaping. Half of that time comes from Spyder displaying the mosaics. I could disable that and get it done even faster.
Works for an arbitrary number of images and dimensions. As I collect more cards, I can take pictures and expand these mosaics with ease. I can also change the aspect ratio however I see fit. I could even do this for my thousands of other pictures.
The final result is pretty great. There is an obvious gradient in the above image and at first glance looks like something I would make myself.
The empty cells. With most numbers of images, the mosaic will have some empty spots. Putting them in the top left works well enough here, but what if I wanted to arrange the cards not by brightness but by color alone? I want to experiment with making them some color instead of white and placing them near like-colored decks so they blend in nicely.
It's only pretty great, not perfect. Upon close inspection, there are clear outliers that are easy to put in more logical places, but are not easy for computational find.
For example, the white/green "Bicycle Snowman" deck in the lowest row could switch with either the "Erotica" deck or its neighbor, creating a more pleasing collection of green decks towards the top right.
I've experimented with minimizing a global "color smoothness" parameter by switching random cells, but have yet to find a technique that doesn't introduce outliers in other ways.
The sorting method is too simple. Stratifying by reds and blues works well here, but what if I get a bunch of green decks? I'll then have to change the sorting method, which is tedious and unreliable. I need either a single, robust sorting method, or a way to automatically chose which colors/shades to stratify.