[Cin] Gimp's blend Vs CinGG's blend
Georgy Salnikov
sge at nmr.nioch.nsc.ru
Wed Mar 26 04:19:25 CET 2025
On Tue, 25 Mar 2025, Andrea paz via Cin wrote:
> Gimp
>
> E = 1/255*(D*S)
>
> Instead, CinGG's formula is:
>
> [(Sa+Da-Sa*Da), Sc*(1-Da)+Dc*(1-Sa)+Sc*Dc]
>
> I cannot compare the two formulas, there is one too many Sc*(1-Da) and
> one too many Dc*(1-Sa), and a 1/255 is missing.
Andrea, 1/255 is just the normalization coefficient to bring the unsigned
byte range [0-255] to the normalized range [0.0-1.0]. This coefficient is
correct for (and only for) the color model RGB 8-bit.
For CinGG the things are more variative. For example, if we have RGB-10bit,
RGB-12bit, etc. than the 1/255 coefficient is not valid any more. In
addition, CinGG has color model RGB-float whose range is [0.0-1.0] already
and requires no normalization coefficient at all.
To make it easier and more consistent, Blend Algebra transforms the actual
color model to float and brings it in the range [0.0-1.0] before executing
user's function. Thus, the 1/255, or whatever normalization coefficient in
Blend Algebra is taken into account intrinsically.
> There are three types of blends whose formulas differ (and which I
> wanted to implement via Blend Algebra):
> (Normal); Addition; Subtract and Divide.
Andrea, you can just try your own Blend Algebra functions according to
formula of Gimp, modify them and test the resulting look. In Blend Algebra
you do not need 1/255, nor any other normalization, it is intrinsic there.
Also pay attention, what are source and destination, and the track order in
the dialog, sometimes it can be counterintuitive:(
> PS: I tried to look for the formulas used by CinCV but I don't know
> where to find them; do they exist anywhere?
Don't search the working formula in Cinelerra's (any branch) source code,
they are horrible.
_______________________________________________________________________________
Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone +7-383-3307864
Email sge at nmr.nioch.nsc.ru
_______________________________________________________________________________
More information about the Cin
mailing list