News for hackers. Stuff that matters.
Re:Brute Force Colors by vinkelhake on Saturday December 31, 2022 @08:13PM (#34202541)
This was a fun read! I didn't expect to read an article about HAM6 today. Now onto the mandatory quibble/question. My gut feeling was that this kind of problem is a combinatorial one and that selecting the palette entries one by one isn't necessarily going to find the solution that has the least error globally?

As an analogy. Suppose we have a simple gradient from black to white (and that we already have those two shades locked down). Now we're tasked with finding a third shade. This type of algo should find the shade at 50% as the one that reduces error the most. If we then find another, it'll be one either at 25% or 75%. An algo that goes through all the combinations of two entries should find that picking 33% and 66% might reduce the overall error.

I feel like I'm missing something.

Re:Brute Force Colors by drcode on Saturday December 31, 2022 @11:32PM (#34203636)
Agreed, you might be able to get better results brute forcing multiple colors at once at a lower color resolution, then gradient descent the optimal colors from there.

One other obvious optimization is to use a more sophisticated metric for "closeness" based on human color perception, not just simple pixel value delta- that could make a huge difference for the skin tones in the final example image.