Re: Compositing math in SVG

Am 15.07.12, 19:22 -0700 schrieb Rik Cabanier:
> On Sat, Jul 14, 2012 at 1:14 AM, Kai-Uwe Behrmann <ku.b@gmx.de> wrote:
>> Rik Cabanier <cabanier@gmail.com> schrieb:
>>> On Fri, Jul 13, 2012 at 10:36 AM, Calculemus
>>> <calculemus1988@gmail.com>wrote:
>>> When you blending 2 images, you need to make sure that they are in the
>>> same
>>> colorspace (aka the blending colorspace).
>>> If they are, I think you can just apply the blending formula's to the
>>> raw
>>> values. (1 in the blending formulas represents the maximum value of the
>>> your colorspace).
>>> If they are not, or the colorspace has no maximum/minimum values, you
>>> will
>>> need to convert to a wide gamut colorspace, blend in that and then
>>> convert
>>> back.
>>
>> You can of course us a logarythmic function or a tone mapping op, which
>> looks much better than per channel clipping. The later one easily causes
>> not so nice colour casts.
>>
>>
> If your colorspace is wide enough there should not be any clipping. Make
> sure it is a wide gamut RGB if you want the same blending.
> Blending in CMYK or Lab looks very different for the same blend mode.
>

Any colour space can hold values over white and thus will expose artifacts 
for those over white colour values, if plain per channel clipping is 
deployed.

Here a additive blending example with a colour perception error:
RGB 0.75,0.5,0.0 +    (warm earthy yellow)
RGB 0.75,0.5,0.0 =>   ( " )
------------------------------------------
RGB 1.5,1.0,0.0       (emitting orange, not displayable on paper/LCD)

after per channel clipping the result is a
RGB 1.0,1.0,0.0       (yellow)

kind regards
Kai-Uwe

Received on Monday, 16 July 2012 06:13:48 UTC