RSS/Atom feed Twitter
Site is read-only, email is disabled

Multiply blend mode in GIMP

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Multiply blend mode in GIMP Calculemus 09 Jul 19:21
  Multiply blend mode in GIMP Michael Henning 09 Jul 19:39
  Multiply blend mode in GIMP Simon Budig 09 Jul 20:35
   Multiply blend mode in GIMP Calculemus 09 Jul 21:50
    Multiply blend mode in GIMP Calculemus 09 Jul 23:40
  Multiply blend mode in GIMP Richard Gitschlag 10 Jul 15:00
Calculemus
2012-07-09 19:21:46 UTC (almost 13 years ago)

Multiply blend mode in GIMP

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

Michael Henning
2012-07-09 19:39:27 UTC (almost 13 years ago)

Multiply blend mode in GIMP

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 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
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list

Simon Budig
2012-07-09 20:35:15 UTC (almost 13 years ago)

Multiply blend mode in GIMP

Calculemus (calculemus1988@gmail.com) 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?

for 8 bit modes 255 is equivalent to the value 1.0. So the proper formula would be

E = (M/255 * I/255) * 255.

I guess you can see how the other formula happens then :-)

Bye, Simon

Calculemus
2012-07-09 21:50:19 UTC (almost 13 years ago)

Multiply blend mode in GIMP

Oh, I see now, thanks!

What about divide? E = (256*I) / (M+1)

This can produce weird values. What if I = 255 and M = 0. Then we have 256 * 255 / 1 = 65 280 and that does not make sense.

Calculemus
2012-07-09 23:40:28 UTC (almost 13 years ago)

Multiply blend mode in GIMP

Another confusing blend mode is Overlay.

I have found 4 sources that have one definition for Overlay, and GIMP uses another one, I am confused.

1. The official Adobe reference version 1.7 chapter 7.2.4 2. http://www.gegl.org/operations.html#op_svg:overlay 3. https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending 4. http://www.pegtop.net/delphi/articles/blendmodes/overlay.htm

Thanks

Richard Gitschlag
2012-07-10 15:00:08 UTC (almost 13 years ago)

Multiply blend mode in GIMP

Date: Mon, 9 Jul 2012 21:21:46 +0200 From: calculemus1988@gmail.com
To: gimp-developer-list@gnome.org
Subject: [Gimp-developer] Multiply blend mode in GIMP

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
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Other people have answered it already, but an alternate way of looking at the Multiply formula is:



E = M * (I / 255)
...or...
E = (M/255) * I



Where M (the multiply layer) values are expressed in a 0...255 range, therefore, (M/255) yields a 0-1.0 percentage and that is exactly the behavior we need.

The documentation could probably be phrased just a little better.

-- Stratadrake
strata_ranger@hotmail.com
--------------------
Numbers may not lie, but neither do they tell the whole truth.