9 ms·
> This is done by finding the nearest neighbours in the RGB space. Noooooo. RGB is not useful for anything but computer displays. Always use a suitable color s
by anc84 9y ago
> This is done by finding the nearest neighbours in the RGB space.
Noooooo. RGB is not useful for anything but computer displays. Always use a suitable color space if you want to calculate with color values. Eg a CieLAB one or similar.
- rf15 9y agoI think going for anything BUT rgb based on a digital rgb source image is beyond the scope of this experiment. You are not dealing with a real image, don't bother with real color space, ESPECIALLY if you filter it all down to a palette that is even more limited. EDIT: after looking into this: CieLAB is still beyond scope, but a good solution for nearest color when you want to be accurate to that degree.
- JustFinishedBSG 9y agoBut distances don't mean anything in the RGB space, so NN is meaningless
- dagw 9y agoWhile you are of course correct, it would be interesting to see how much the choice of color space actually matters in this particular case.
- deleted 9y ago[deleted]
- dagw 9y agoJust did a quick test with both HSV and LAB and honestly RGB seems to give the best results at least to my eye. This seems to be to be one of those cases where the simple and obvious approach appears to give a better result than the 'correct' approach
- boomlinde 9y agoDistances in RGB space certainly mean something in the sense that you get a rough approximation that gets more convincing the more colors you quantize to. Decent for some purposes, while for others you need a space that more closely maps to human perception.
- ska 9y agoThey aren't meaningless, they just aren't perceptually linear.
- royalityfun 9y agoYou are right. This was one of the first feedback, I've got from others as well, so I added LAB. It is currently not in the repo (sry about that), but here is an image for comparison: https://imgur.com/a/FVieK https://imgur.com/a/FVieK I was left with the impression that RGB was sufficient for my simple cases.
- anc84 9y agoNice! I feel bad that my criticism is the highest comment at HN at the moment and how I did not even say how much I enjoyed reading your post. Great project which I will share with my students for inspiration. :)
- codingdave 9y agoBut RGB is simple code. I have run a site for years that converts photos into craft designs, and calculates with RGB. It might not be the best solution, and there are concerns with the color matching....but it is good enough to have now produced over 580K designs, gotten positive feedback, and has resulted in small side income for years. (And I recently sold the site.) Sometimes "good enough" works.
- koonsolo 9y agoNot sometimes! "Good enough" is ALWAYS... good enough! :)
- kurthr 9y agoXYZ (or Yuv) is also simple, since it is a single 3x3 matrix conversion away from RGB and it is relevant to huuman perception rather than display capability. In some cases people may not notice, but it others RGB-NN is clearly not the best... so why not try a bit harder, when it's a few lines of code and opcodes.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]