2

My question is related to the previous question: Count the number of colors of images

Is there any way to count the difference between colors (e.g. luminance)? If the difference between the two colors were too small, it will automatically considered as 1 color instead of two colors. This way, what people perceived of the number of colors of image will be more close with what the computer counts.

Thanks

Community
  • 1
  • 1
Jessy
  • 15,321
  • 31
  • 83
  • 100

2 Answers2

1

Now you're trying to calculate Delta E. Perhaps a color science and/or imaging science book would be a wise investment :)

See this previously answered question for the information you seek:

Compare RGB colors in c#

Community
  • 1
  • 1
djdanlib
  • 21,449
  • 1
  • 20
  • 29
0

In fact you can get luminance by:

 luminance = (int) (redValue + greenValue + blueValue);

To get the main idea review the use of redValue, greenValues and blueValue.
Check this Picture.java

code from Barbara Ericson ericson@cc.gatech.edu

edgarmtze
  • 24,683
  • 80
  • 235
  • 386