digitalmars.D - [OT] a good color distance function
- Justin Johansson (19/19) Oct 14 2010 Can anyone please suggest a decent algorithm for
- BCS (8/13) Oct 14 2010 I'd work in HSV. convert the hue channel to an absolute difference and t...
- Justin Johansson (3/9) Oct 15 2010 Thanks BCS for these useful ideas.
- ponce (1/9) Oct 14 2010 Google for "daltonization"
- Justin Johansson (3/12) Oct 15 2010 Another useful tip. Thanks also ponce.
- =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= (13/23) Oct 16 2010 In the imaging industry (printers, scanners and screens), we
Can anyone please suggest a decent algorithm for determining a "color distance" metric between two colors? The requirement is to come up with a good algorithm for contrasting a computed color from another color. Should this algorithm (function) be dependent upon whether the color model be additive (aka RGB) or subtractive (aka CMYK) or other? Also should a decent "color distance" function take in to account the possibility of color blindness disability amongst the potential audience? Somehow me thinks that (in say an RGB model) a Pythagorean square-root of the the sum of the squares of the respective RGB axis deltas is, whilst mathematically pleasing, not best practice for contemporary ideals/political correctness for addressing accessibility/visual impairment issues. Thanks in advance for your input, Justin Johansson
Oct 14 2010
Hello Justin,Can anyone please suggest a decent algorithm for determining a "color distance" metric between two colors? The requirement is to come up with a good algorithm for contrasting a computed color from another color.I'd work in HSV. convert the hue channel to an absolute difference and then combine with a weighted sum. You might also take a look at some graphics design ideas about the color wheel (e.g. make the f(H) have peeks for complementary colors) and you could have some fun with a crowd sourced fitness function driving a GA to get the tuning factors right. -- ... <IXOYE><
Oct 14 2010
On 15/10/2010 1:16 AM, BCS wrote:Hello Justin, I'd work in HSV. convert the hue channel to an absolute difference and then combine with a weighted sum. You might also take a look at some graphics design ideas about the color wheel (e.g. make the f(H) have peeks for complementary colors) and you could have some fun with a crowd sourced fitness function driving a GA to get the tuning factors right.Thanks BCS for these useful ideas. Cheers, Justin
Oct 15 2010
Somehow me thinks that (in say an RGB model) a Pythagorean square-root of the the sum of the squares of the respective RGB axis deltas is, whilst mathematically pleasing, not best practice for contemporary ideals/political correctness for addressing accessibility/visual impairment issues.Google for "daltonization"
Oct 14 2010
On 15/10/2010 2:54 AM, ponce wrote:Another useful tip. Thanks also ponce. Cheers, JustinSomehow me thinks that (in say an RGB model) a Pythagorean square-root of the the sum of the squares of the respective RGB axis deltas is, whilst mathematically pleasing, not best practice for contemporary ideals/political correctness for addressing accessibility/visual impairment issues.Google for "daltonization"
Oct 15 2010
Justin Johansson wrote:Can anyone please suggest a decent algorithm for determining a "color distance" metric between two colors? The requirement is to come up with a good algorithm for contrasting a computed color from another color. =20 Should this algorithm (function) be dependent upon whether the color model be additive (aka RGB) or subtractive (aka CMYK) or other? =20In the imaging industry (printers, scanners and screens), we usually use the L*a*b* [1] or L*u*v* [2] color spaces. Pythagorean distances in these spaces give reasonably good results, but more advanced measures have been developed [3] if you need more precision. Jerome [1] http://en.wikipedia.org/wiki/Lab_color_space [2] http://en.wikipedia.org/wiki/CIELUV_color_space [3] http://en.wikipedia.org/wiki/Color_difference --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Oct 16 2010