As I said, I know it's hard, and I also said that I probably couldn't do better myself. Excuse me if this came across as nitpicking but it's really meant as constructive criticism.turboxray wrote: ↑Tue Sep 06, 2022 7:13 pm I take it you have no experience in this kind of stuff. It's not trivial in the least. I've written my own, refined it over the years, and I gave up on trying to make it "perfect". The best it does is get really close, and then lets the artist finish it off with manual touch ups. This is bar far THEE most impressive attempt I've seen yet - maybe only matched by Nitro Character Studio for GBA development that does this (and good luck finding that official app from Nintendo).
It's not that easy though. The tricky question is how to split colors in half.
I set fraction of pixels to "1.0" (higher is better I guess?), the square artifacts are less noticable with higher values but still there, especially in the dark / blue parts, or around the edges of the star in the bottom right corner you can notice there's an area that's more purple than the sorrounding part.
They're also visible in the demo images you posted for example in the buzzlook one.
I've glanced over the code (in worker.js) though not in detail, and it seems you're shuffling tiles into different palettes and then requantize with a kind of hill climbing method?