|
Hi,
On Thu, 28 Jul 2005, Vishwanath Somashekar wrote:
> from one image to the other, you will see a increase in the purple
> color.
You might want to play around with "Image/Type/RGB Stack" and
"Image/Type/HSB Stack".
More generally, you also could write a macro, which labels pixels being
approximately the target color, like
-- snip --
targetRed=255;
targetGreen=50;
targetBlue=0;
for(i=0;i<getWidth();i++)
for(j=0;j<getHeight();j++) {
pixel=getPixel(i,j);
red=((pixel>>16)&0xff);
green=((pixel>>8)&0xff);
blue=((pixel)&0xff);
distance=floor(sqrt(((red-targetRed)*(red-targetRed)
+(green-targetGreen)*(green-targetGreen)
+(blue-targetBlue)*(blue-targetBlue))/3));
newValue=(distance<<16)|(distance<<8)|distance;
setPixel(i,j,newValue);
}
-- snip --
This will set a gray value which represents the distance of the pixels's
color to the target color. By counting how many pixels have a newValue<20,
you have a measure "how purple the image is".
Hth,
Dscho
|