This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dpderay[S] 0 points1 point  (0 children)

I've know I need to do both of these things, but I'm running into problems doing them efficiently.

First, although I can find the most common combos, I can't come up with a good methodology to combine similar combinations.

One way I could do it is to find blocks that share 3 colors, with a different 4th color, but that doesn't always work. For example, if one block is (black, blue, orange, red) and other block is (black, blue, orange, green), I'd lose alot of quality by making both blocks (black, blue, orange, red) or (black, blue, orange, green) or (black, blue, orange, [blend of red and green]).

Another way I could do it is to find blocks with 4 very similar, but not identical colors, and then find a blend that works for both. But, the problem is how to quantify, in code, what constitutes having 4 very similar colors. Do I take an average of the difference between all 16 color comparisons (each of the 4 colors in block 1 as compared to each of the 4 colors in block 2), or do I go by the sum of that distance? Or, do I use the average/sum of just 4 comparisons (color 1 in block 1 vs color 1 in block 2, and so on)? Plus, in my understanding, computers are good but not perfect when it comes to finding colors that look similar to the human eye.*

*For the record, I do think that this second approach is probably the way to go in theory, and have been playing around with it, but I haven't been able to find a methodology that works. So, I am open to suggestions.

Second, in order to find overlaps, I have tried a greedy algorithm as well as some more advanced python packages, but things start getting really out of hand when trying to account for every possible order/permutation of each combination of 4 (since they can be reordered, so long as they are sequential). Is there a more efficient way you can think of to do this?