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

Alpha compositing

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.

Alpha compositing JS 12 Apr 18:06
  Alpha compositing Joao S. O. Bueno Calligaris 14 Apr 02:12
   Alpha compositing Joao S. O. Bueno Calligaris 14 Apr 02:45
    Alpha compositing JS 18 Apr 22:37
Alpha compositing William Skaggs 12 Apr 18:14
  Alpha compositing JS 12 Apr 18:25
JS
2005-04-12 18:06:08 UTC (about 19 years ago)

Alpha compositing

Hi,

I'm trying to locate the alpha compositions code in Gimp and cannot find it. I've found C/MMX/Altivec versions of many image-image composition operations but they don't seem to use the alpha channel at all.

For example, I wonder wether the "overlay" composition corresponds to the Porter-Duff "over" operand. I've seen that some of the Porter-Duff operations are now part of GGGL (http://pippin.gimp.org/gggl/). I'm a little lost in all this. So I guess my questions are:

1) Does Gimp implement the 12 Porter-Duff operations (http://www.w3.org/TR/2002/WD-SVG11-20020215/masking.html)? If so, I guess they must have different names. 2) Where are the specifications for the compositing functions found in Gimp (like blend, screen, overlay, etc)? None of these functions seem to make use of the alpha channel, but is there still a link I do not see with the Porter-Duff ops?
3) Where is Gimp heading wrt composition ops? Is GGGL the new standard?

Thanks,

William Skaggs
2005-04-12 18:14:26 UTC (about 19 years ago)

Alpha compositing

Hi Jean-Sébastien,

Probably the code you are looking for can be found in app/paint-funcs/paint-funcs-generic.h.

Also you might find it helpful to take a look at this bug report:

http://bugzilla.gnome.org/show_bug.cgi?id=162395

Best, -- Bill


______________ ______________ ______________ ______________ Sent via the CNPRC Email system at primate.ucdavis.edu

JS
2005-04-12 18:25:35 UTC (about 19 years ago)

Alpha compositing

Hi Bill,

Thanks for the ref. I had already found that code though. However, what I'm looking for right now are alpha-blending ops.

None of the functions that are found in app/paint-funcs/paint-funcs-generic.h seem to make use of the alpha channel in their calculation. None of them seem to be one of the Porter-Duff operations. But since gimp has a layer mode that seems to take into account alphas, I'm wondering where the code for that is.

Cheers,

JS

William Skaggs wrote:

Hi Jean-Sébastien,

Probably the code you are looking for can be found in app/paint-funcs/paint-funcs-generic.h.

Also you might find it helpful to take a look at this bug report:

http://bugzilla.gnome.org/show_bug.cgi?id=162395

Best, -- Bill

______________ ______________ ______________ ______________ Sent via the CNPRC Email system at primate.ucdavis.edu

Joao S. O. Bueno Calligaris
2005-04-14 02:12:28 UTC (about 19 years ago)

Alpha compositing

On Tuesday 12 April 2005 13:06, JS wrote:

Hi,

I'm trying to locate the alpha compositions code in Gimp and cannot find it. I've found C/MMX/Altivec versions of many image-image composition operations but they don't seem to use the alpha channel at all.

For example, I wonder wether the "overlay" composition corresponds to the Porter-Duff "over" operand. I've seen that some of the Porter-Duff operations are now part of GGGL (http://pippin.gimp.org/gggl/). I'm a little lost in all this. So I guess my questions are:

1) Does Gimp implement the 12 Porter-Duff operations (http://www.w3.org/TR/2002/WD-SVG11-20020215/masking.html)? If so, I guess they must have different names. 2) Where are the specifications for the compositing functions found in Gimp (like blend, screen, overlay, etc)? None of these functions seem to make use of the alpha channel, but is there still a link I do not see with the Porter-Duff ops? 3) Where is Gimp heading wrt composition ops? Is GGGL the new standard?

Thanks,

Hi! The
app/paint-funcs/paint-funcs-generic.h. file Bill pointed too is not used anymore - it is there in case someone builds the GIMP disabling aceleration with an option I forgot which is.

For the composting functions, take a look in the app/composite directory, in the "gimp-composite-generic.c" file. Some of the functions are acelerated for MMX or SSE in the corresponding files, others are not.

As for your question (reading about Porter Duff) wow... comparing 12 kindso oif operations is a lot - but AFAIK the compositing models on the GIMP were not created thinking on these specific Ops. Some may be the same, others certainly are not. http://bugzilla.gnome.org/show

2) There is not a proper Spec. This area of the current Docuemtnation is finding lacking, and there is even a bug openned against the docs. A better description can be found on the older "groking the GIMP" book for some of the modes. Currently, teh best way to know what eachmode does, if the explanation in the above sources does nto suffice, is checking the code in the above file.

3) No. GEGL is not in use yet. As I told, the funciotns are in the app/composite directory.

4) Please, take a look at http://bugzilla.gnome.org/show_bug.cgi?id=161449 for a way to check a cheap way of implementing these new combination modes in a way that would not cluter the GIMP ui. If there is people wanting it working (custom layer modes) , I could go backk to work on it, even making it available to the GIMP if GEGL use is further stalled.

5) Nice name this of yours!

Regards, JS
->
João Sebastião de Oliveira Bueno Calligaris

Joao S. O. Bueno Calligaris
2005-04-14 02:45:54 UTC (about 19 years ago)

Alpha compositing

On Wednesday 13 April 2005 21:12, Joao S. O. Bueno Calligaris wrote:

On Tuesday 12 April 2005 13:06, JS wrote:

Let's see how far I can MAP these SVG comp. modes to GIMPs:

1) clear: Not available as a composite mode. One might just turn the layers visibility off.

2) src:No mode. Turn off the visibility of the dst layer. 3) dst: No mode. Turn off the visibility of the src layer. 4) src_over: mode "behind"
5) dst_over: mode "normal"
6) src_in: no equivalent mode. There would be needed another (custom) mode mode that would multiply or "lighten only" the alpha component, and ignored the dst color.
7) drc_in: no equivalent mode. There would be needed another mode that would multiply or "lighten only" the alpha component, and ignored the src color.
8) src_out: no equivalent mode. There would be needed another mode that would multiply or "lighten only" srca by the complement of dsta, and ignored the dst color.
9) dst_out: no equivalent mode. There would be needed another mode that would multiply or "lighten only" srca by the complement of dsta, and ignored the dst color.
10) src_atop: no equivalent mode. There would be needed another mode that would be like the current behind mode, but use dsta instead of srca
11) drt_atop: no equivalent mode. There would be needed another mode that would be like the current normal mode, but use srca to replace dsta.
12) src_atop: no equivalent mode. A XOR_alpha mode would be needed to emulate this.
------------

Apart of the nice code I pointed in the other e-mail, I have a current python script is flexible enough to easily do these compositions. As a plug-in, however, it doesn't operate in real time: you have to draw you layers, and call the plug-in to generate a resulting layer from the operation.

If you are interested I can have it dealing with these 12 modes in a little more than an hour.

JS
->

JS
2005-04-18 22:37:41 UTC (about 19 years ago)

Alpha compositing

Hi JS,

Thanks for the precisions. I'm working on a real-time video processing software (http://drone.ws). I have integrated the composition functions found in gimp-composite* and they work remarkably. I'll take a look at the src_over/dst_over implementations and compare them with my own impl. to see which is faster. I'll probably implement the other operators as well but only for RGBA. Since GEGL seems to support different color models, my implementation will doubtly be useful to you (would it?)

Thanks again.

Best,

JS

Joao S. O. Bueno Calligaris wrote:

On Wednesday 13 April 2005 21:12, Joao S. O. Bueno Calligaris wrote:

On Tuesday 12 April 2005 13:06, JS wrote:

Let's see how far I can MAP these SVG comp. modes to GIMPs:

1) clear: Not available as a composite mode. One might just turn the layers visibility off.

2) src:No mode. Turn off the visibility of the dst layer. 3) dst: No mode. Turn off the visibility of the src layer. 4) src_over: mode "behind"
5) dst_over: mode "normal"
6) src_in: no equivalent mode. There would be needed another (custom) mode mode that would multiply or "lighten only" the alpha component, and ignored the dst color.
7) drc_in: no equivalent mode. There would be needed another mode that would multiply or "lighten only" the alpha component, and ignored the src color.
8) src_out: no equivalent mode. There would be needed another mode that would multiply or "lighten only" srca by the complement of dsta, and ignored the dst color.
9) dst_out: no equivalent mode. There would be needed another mode that would multiply or "lighten only" srca by the complement of dsta, and ignored the dst color.
10) src_atop: no equivalent mode. There would be needed another mode that would be like the current behind mode, but use dsta instead of srca
11) drt_atop: no equivalent mode. There would be needed another mode that would be like the current normal mode, but use srca to replace dsta.
12) src_atop: no equivalent mode. A XOR_alpha mode would be needed to emulate this.
------------

Apart of the nice code I pointed in the other e-mail, I have a current python script is flexible enough to easily do these compositions. As a plug-in, however, it doesn't operate in real time: you have to draw you layers, and call the plug-in to generate a resulting layer from the operation.

If you are interested I can have it dealing with these 12 modes in a little more than an hour.

JS
->
_______________________________________________ Gimp-developer mailing list
Gimp-developer@lists.xcf.berkeley.edu http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer