renasboy / php-color-difference

PHP Color Difference using Delta E CIE 2000
22 stars 13 forks source link

* * * New GitHub Project Quoting You and This Repo * * * #3

Open tajmone opened 8 years ago

tajmone commented 8 years ago

Dear @renasboy,

I couldn't find an email address to contact you at, so I'm using GH Issues.

I'm contacting you to inform you that I've just release an open source (MIT licensed) project that refers to your work in its credits.

The project is:

https://github.com/tajmone/name-that-color

It a CLI tool that takes color values (Hex or RGB) as input and returns a color name, based on a table of 1566 colors. It either finds an exact match, or it calculates dE00 distance between target color and all colors in the list, returning the nearest match.

I've relied heavily on your php-color-difference repo while working on the project: I've ported to another language your dE00 class.

You are mentioned in the credits:

I hope I have credited you in a due manner, and that you are happy with the way I've done it. If there are any mistakes on my side, or if I've misunderstood your licensing terms, please let me know and I'll provide to fix any errors on my side.

In the meantime, I want to thank you personally for your precious contribution to my project and to my learning of dE00.

Best regards,

Tristano Ajmone (Italy)

renasboy commented 8 years ago

Hi Man,

cool that you did it and mention my stuff,

dont worry, it shall all be fine ;-)

have fun and keep on sharing

kthangabalu commented 7 years ago

Hi Mate,

Thanks for the post. Very useful library. Just one question , what is the ideal value to compare the least color difference.

tajmone commented 7 years ago

The actual value might depend on what you are trying to achieve. As a general reference you can follow these guidelines:

         .====================================================.
         |  Delta E  |            Perception                  |
         |----------------------------------------------------|
         | <= 1.0    | Not perceptible by human eyes.         |
         |    1 - 2  | Perceptible through close observation. |
         |    2 - 10 | Perceptible at a glance.               |
         |   11 - 49 | Colors are more similar than opposite. |
         |  100      | Colors are exact opposite.             |
         |----------------------------------------------------|
         | taken from Z.Schuessler:                           |
         | -- http://zschuessler.github.io/DeltaE/learn/      |
         `===================================================='

... and chose a value within those ranges that meets your goal. As you can see, each range as its own lower- and upper-bounds, so you'll have to decide what a "least difference" is in your context — ie: perceptible to the human eye or not? at close inspection or at a glance?

All of these ranges take in consideration the human eye bias in color perception.

You can read a good introductiory tutorial on the dE algorithms family at the following link:

... it's a good tutorial that guides you through the history of dE and its applications.

dgironella commented 6 years ago

@renasboy

Hi

I your sure that you code work?

`include('lib/color_difference.class.php');

$rgb1 = [ 0, 0, 0 ]; $rgb2 = [ 255, 255, 255 ];

$color_difference = (new color_difference())->deltaECIE2000($rgb1, $rgb2);

print $color_difference . chr(10); ` This code give a value of 132.86015983793, when it will be 100

Thanks,.

David Gironella

tajmone commented 6 years ago

I think that 100 is a just a threshold value on the dE2000 scale — meaning that any value >=100 should be treated as 100 since distinctions beyond that value are not meaningful for practical uses in establishing color difference.

But I'm not 100% sure about this, so I might be wrong. And I'd like to ear @renasboy on this point.

Anyhow, I think It's up to you to clamp the returned value within the 0–100 range. Most online dE2000 calculators will show as 100 any value >=100, for practical reasons.

Also, keep in mind that different apps and algorithms might differ slightly in their results depending on the precision used for float numbers, and the settings for rounding results. Moreover, here there is a further passage of conversion from RGB to CIELAB, which is also subject to float precision and rounding.

renasboy commented 6 years ago

Hi There, thanks for the feedback,

there might be little discrepancies, the project worked for us when we needed it, maybe it needs adjustments, please feel free to fork it and fix it :-)

regards,