[Cin] Gimp's blend Vs CinGG's blend

Andrea paz gamberucci.andrea at gmail.com
Wed Mar 26 13:56:25 CET 2025


I tried Multiply blend in Blend Algebra whit the gimp's formula (based
on arith_multiply.ba, which I called gimp_multiply.ba). It works
without the normalization (which, as you said, is implicit in CinGG):

R_OUT = (R(s) * R(d));
G_OUT = (G(s) * G(d));
B_OUT = (B(s) * B(d));
A_OUT = A(s) + A(d) - A(s) * A(d);

The result is the same as CinGG's formula and Patchbay's overlay. This
seems normal to me since they should be the same formula. The alpha
channel line is irrelevant, everything works with or without this
line.

So gimp_multiply.ba is equivalent to arith_multiply.ba. I don't
understand why, though. Adam or GG must have used a “way” to translate
the Gimp formulas into their own formulas in CinGG, but I don't
understand this way.
I tried to create the Divide, Addition and Subtract formulas (which, I
recall, are different in CinGG from those in Gimp):

Divide(gimp):     E = (S * 256) / (D + S)

Addition(gimp):   E = min((D + S), 255)

Subtract(gimp):   E = max((S - D), 0)

I created gimp_addition.ba and gimp_subtract.ba and they work, but
they are useless because you get the exact same result as the ones in
CinGG. I thought that since the formulas are different you get
slightly different results. I attach them for those who want to test
or as a curiosity, but I repeat that they are useless. Instead I don't
know how to do gimp_divide.ba because of the parameter “256” which I
don't know how to use.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gimp_.tar.gz
Type: application/gzip
Size: 451 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20250326/5325382f/attachment.bin>


More information about the Cin mailing list