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

Georgy Salnikov sge at nmr.nioch.nsc.ru
Thu Mar 27 04:17:28 CET 2025


On Wed, 26 Mar 2025, Andrea paz wrote:

> Divide(gimp):     E = (S * 256) / (D + S)
>
> Addition(gimp):   E = min((D + S), 255)
>
> Subtract(gimp):   E = max((S - D), 0)
>
> know how to do gimp_divide.ba because of the parameter \u201c256\u201d which I
> don't know how to use.

When adapting blend formula taken from somewhere, to CinGG's Blend Algebra,
in each place where you find either 256 or 255, change it to 1.0, and in
every place where you see 128 or 127, with either plus or minus sign, change
it to 0.5 with the same sign. These all digits are nothing else than
normalization coefficients to convert 8-bit integers to floats, which are
preconverted in Blend Algebra.
_______________________________________________________________________________

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