Long story short, there is this hardware that can only display around 6-7 types of irregular pixels like (47,160,30), (229,52,10),(0,60,190), etc. How do display an RGB image with these irregular pixels with minimum error? My approach is just displaying the pixel closest to the original(by checking the difference on RGB values) with dithering, but the results seem always off. Is there a way I can somehow compare the colors, or any book I can refer to?
In order to calculate the distance between colours from a human point of view you will need to convert RGB to a Lab colour space. This wikipedia article has all math you will need: https://en.wikipedia.org/wiki/Color_difference and this one https://en.wikipedia.org/wiki/Lab_color_space#RGB_and_CMYK_conversions has the math on conversion between RGB and Lab
A solution is also proposed in this answer: Compare RGB colors in c#
And a library available here: https://github.com/THEjoezack/ColorMine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With