Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpected colors after multiplying image




Hi,

I want to multiply the colors in an image with a solid color,
i.e. pure green to mimic the behaviour of a BW-Photo filter.

The Multiply Patch as well as the sample Kernel Patch (which is a multiplier)
as well as my custom written patch do not produce the expected colors.


My test image contains three R/G/B discs - when I multiply it with RGB (0,1,0,1)
I don't get the expected black for red and blue but (0.38,0.09,0) for red
and (0,0.13,0.17) for blue (values taken as Device RGB with the color panel tool).


If I use the multiply option of the billboard instead I see the expected result.

I suspected something along the lines of color management may play a role
but I think the colors are too far off for that alone.
Interestingly if I replace a __color parameter in my custom kernel with a vec4
and a RGB Color patch in front of it the color changes take a different turn -
less saturation, luminosity still wrong.


I have attached a small composition as a testcase, it has inputs,
Hit Command-T on the viewer and set one of the colors to green and
the other to white, then vice versa and you should see the effect.

Also attached is a low quality jpeg for a quick impression of what I am whining about here.

Any enlightenment appreciated very much,

   Bjoern


this is the custom kernel with a vec4 parameter:

kernel vec4 bwEffect(sampler image, vec4 filterColor, float brightnessCorrection)
{
__color i = sample(image, samplerCoord(image));


float value = filterColor.r * 0.299 + filterColor.g * 0.587 + filterColor.g *0.114;

    float corr = value > 0.01 ? 1.0 / value : 100.0;

    __color o = i * filterColor;

    float gray = (o.r * 0.299 + o.g * 0.587 + o.b * 0.114);

gray = brightnessCorrection > 0.0 ? gray * corr * brightnessCorrection : gray;

    o.r = o.g = o.b = gray;

    return o;
}





Attachment: QC_Multiply.qtz
Description: application/quartzcomposer




JPEG image




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.