Well, if speed is not a problem, the most accurate way would be to take some sample images and apply a filter to them using different cutoff values ββfor the distance (the distance is determined by one of the equations on the Color_difference page, which you will need to use one of those color spaces that are listed there with calculations, and then convert to sRGB or something [which also means that you will need to first convert the image to a different color space if it is not in To begin with]), and then a large number of people explore the image to see what it is best suited, then go to the cutoff value for images that most agree with the best results.
Basically, this is largely a matter of subjectivity; In fact, it also depends on how stylized your images are, and you might even want to add some kind of control so you can change the clipping distance on the fly.
If speed becomes a bit of a problem and / or you need more simplicity, just use your second choice to calculate the distance (this is just the CIE76 equation, just make sure you use the Lab * color space) with cropping is around 2 or 2.3.
source share