There I was, scrolling through my Discord servers, when I saw this link: https://www.keithcirkel.co.uk/whats-my-jnd/
It was a small program to calculate the Just Noticeable Difference between two colours, or the JND. Reading the blogpost linked, it mentioned an algorithm called the “CIEDE2000.” And that’s when it hit me—the CIE is a real organization. Of course they would have a formula to calculate the similarities between two colours. That meant that I didn’t have to iterate through my array of wallpaper colours and do simple less-than checks—using CIEDE2000 would be much more accurate. Thankfully, there’s an npm library for this: color-diff. (I was NOT about to implement all that myself.) I also added a bit of randomization to the algorithm, so that should ensure you’re not getting the same wallpaper all the time if you live somewhere where there’s consistent weather patterns.
All in all, this probably constitutes a reship, doesn’t it? I’ll probably be tweaking the algorithm slightly as I continue to use it, so stay tuned…
Comments 1
ooo that’s so cool! I played around with that jnd thingy before, but I never thought about the algorithm behind it.
Sign in to join the conversation.