Re: Color comparison
Re: Color comparison
- Subject: Re: Color comparison
- From: Marcel Weiher <email@hidden>
- Date: Wed, 5 Jun 2002 01:45:55 +0200
On Tuesday, June 4, 2002, at 08:48 Uhr, Jason Harris wrote:
You could also use the Euclidean distance in whatever color space your
color
lives in. For RGB, it's
distance = sqrt( pow(r1-r2, 2.0) + pow(g1-g2, 2.0) + pow(b1-b2,
2.0) );
"distance" is a number in the same units as r,g, and b that describes
how
"close" the the two colors are.
For just equality, that probably won't be necessary. If you're actually
trying to get color difference, euclidean distance in RGB is not a good
measure, because RGB is not a perceptually uniform color-space (not even
close). For determining color-distance, use CIE Lab color space ( or
CIE Luv ). For these color-spaces, a delta-E of 1 is approximately the
JND, the Just Noticeable Difference under standard viewing conditions.
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.