Each pixel component has a value somewhere between 0 and 255. When you
multiply two together, it will have a value somewhere between 0 and
65,025 (255 squared). You need to divide by 255 so that maximum value
gets scaled back down to 255 (If you simply clamp it, the majority of
your pixels will be white).

Of course, when working with doubles or floats, 1.0 is normally the
maximum (Non-HDR) value, so no division is needed.

Hopefully that clears things up.
  -- drawoc

On Mon, Jul 9, 2012 at 3:21 PM, Calculemus <[email protected]> wrote:
> I am reading this: docs.gimp.org/en/gimp-concepts-layer-modes.html
>
> and I wonder why is the formula for "Multiply", E = (M * I) / 255?
>
> Why divide with 255, that is the part that confuses me.
> Should it not be just M * I and then clamp the result in range 0 to 255?
>
> Thanks
>
> _______________________________________________
> gimp-developer-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/gimp-developer-list
>
_______________________________________________
gimp-developer-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gimp-developer-list

Reply via email to