<div dir="ltr">Hi Bartek,<div>thanks for your link.</div><div>Computer generated images are rendered directly with their own associated alpha since the alpha itself is a property of each RGB channel and not just a mask.</div>



<div>So unassociating the alpha is a &quot;trick&quot; we have to use to edit (ex post) the colors properly.</div><div>Chatting with Troy I understood a couple of important things that I havent got in the IRC discussion with Ton and Lukas.</div>



<div>I must admit Ton at a certain point told me there is a difference between operation in the nodestree and in the display but at that time I just ignored this information because I havn&#39;t got the importance of this statement.</div>



<div><br></div><div>By default the OpenGL render of the image displayed in the viewer always try to keep the correct image in the meaning of the correctness of a CG image even if it has been forced to be unassociated.</div>



<div><br></div><div>This is definitelly clear when you see (according to my previous samples) an image that IS NOT alpha associated but that IS DISPLAYED as if it should be...</div><div><br></div><div>According to how separate and combine RGBA nodes works (they just get the intensity of each channel as it is given at input time) I should have seen an RGB image + its unassociated alpha but again, the  viewer output &quot;guess&quot; (hope I&#39;m using the correct term here) it&#39;s an associated alpha image and render a result that is not what is really given by the output of the combine node.</div>



<div><br></div><div>To prove my statement here a series of image that perfectly represent what drove me completely crazy.</div><div><br></div><div>The output of the tree should be in both the display mode (color and color+alpha) equal to the next image [1]:</div>


<div>  </div><div><a href="https://lh4.googleusercontent.com/-pAdrH9hboyk/U0EDzz4eQ4I/AAAAAAAAI5s/bZxeEu-0Eds/w1246-h870-no/err06.jpg" target="_blank">https://lh4.googleusercontent.com/-pAdrH9hboyk/U0EDzz4eQ4I/AAAAAAAAI5s/bZxeEu-0Eds/w1246-h870-no/err06.jpg</a><br>


</div><div><br></div><div>What you get in color + alpha mode is this alpha associated visual representation [2]:</div><div><a href="https://lh3.googleusercontent.com/-NASTIfNg2Zo/U0ECBdj5mFI/AAAAAAAAI5M/uIYj0twvlzg/w1246-h870-no/err01.png.jpg" target="_blank">https://lh3.googleusercontent.com/-NASTIfNg2Zo/U0ECBdj5mFI/AAAAAAAAI5M/uIYj0twvlzg/w1246-h870-no/err01.png.jpg</a><br>


</div><div><br></div><div>Moving to  color only you get an image that I would never expect an image twice unassociated (once by the node separate RGBA and once by the display) but that look perfect [3]:</div><div><a href="https://lh6.googleusercontent.com/-WlaTlXci6E0/U0ECBdfoMxI/AAAAAAAAI5M/5ZmiNh8SUlo/w1246-h870-no/err02.png.jpg" target="_blank">https://lh6.googleusercontent.com/-WlaTlXci6E0/U0ECBdfoMxI/AAAAAAAAI5M/5ZmiNh8SUlo/w1246-h870-no/err02.png.jpg</a><br>


</div><div><br></div><div>How this image can be like so? Color only should or should not discard &quot;mask information&quot; that are not associated to the RGB channels?</div><div>In fact as soon as I add an alpha convert node the display shows what I guess should have been the result of the  displayed image [4]:</div>

<div><br></div><div><a href="https://lh3.googleusercontent.com/-1MppyPtA0Zs/U0ECC3n7avI/AAAAAAAAI5M/3IhFhZ61_RE/w1246-h870-no/err04.png.jpg">https://lh3.googleusercontent.com/-1MppyPtA0Zs/U0ECC3n7avI/AAAAAAAAI5M/3IhFhZ61_RE/w1246-h870-no/err04.png.jpg</a><br>

</div><div><br></div><div><br></div><div> And now let me explain further from an artist point of view that do not spend time to go deep in this topic what seems wrong<br></div><div>I&#39;m looking in the color + alpha mode and I see image [2]</div>

<div>then I go to color only and I get image [3]</div><div>so I&#39;m oriented to think, nice the colors are properly unpremultiplied/unassociated during the separate / combine process</div><div>then I add an alpha convert and I get the effect of an image twice associated [5]:</div>

<div><br></div><div><a href="https://lh3.googleusercontent.com/-LptQp3DEoWo/U0ECC2s1OtI/AAAAAAAAI5M/A_B3XPF_06k/w1246-h870-no/err05.png.jpg">https://lh3.googleusercontent.com/-LptQp3DEoWo/U0ECC2s1OtI/AAAAAAAAI5M/A_B3XPF_06k/w1246-h870-no/err05.png.jpg</a><br>

</div><div><br></div><div>How can I know that the operation made at display time aren&#39;t linked to the one made on the tree??</div><div>Should display represent the same output as the nodes do in your opinion?</div><div>

<br></div><div>Thanks for your time and the patient to follow this thread :)</div><div>Francesco</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

2014-04-05 21:27 GMT+02:00 Bartek Skorupa (priv) <span dir="ltr">&lt;<a href="mailto:bartekskorupa@bartekskorupa.com" target="_blank">bartekskorupa@bartekskorupa.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Hey,<div><br></div><div>In November last year I wrote my thoughts about this issue. Nodes IMO are fine, but display is broken and causes a lot of confusion:</div><div><a href="http://wiki.blender.org/index.php/User:Bartekskorupa/Display_Issues" target="_blank">http://wiki.blender.org/index.php/User:Bartekskorupa/Display_Issues</a></div>

<div><br></div><div>Cheers,`<br><div>
<span style="border-collapse:separate;border-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<div>Bartek Skorupa</div><div><br></div><div><a href="http://www.bartekskorupa.com" target="_blank">www.bartekskorupa.com</a></div></div></span></span></span>
</div><div><div class="h5">

<br><div><div>On 5 kwi 2014, at 14:03, Francesco Paglia &lt;<a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr"><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">

Hi Lukas,<br>You&#39;re perfectly right, there are no issue with the combine rgba node.<br>Since I still  think there&#39;s something that sounds me strange I went on trying to understand what&#39;s wrong with me or the node tree! :)</p>

<p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">Finally I got what got me in error!<br>This button:</p><p dir="ltr"><font face="arial, sans-serif"><a href="https://lh6.googleusercontent.com/-8d9zmPWcEdo/Uz_wFciddLI/AAAAAAAAI30/-1I878DqlLU/w259-h72-no/color%252Balpha.png" target="_blank">https://lh6.googleusercontent.com/-8d9zmPWcEdo/Uz_wFciddLI/AAAAAAAAI30/-1I878DqlLU/w259-h72-no/color%252Balpha.png</a></font><br>



</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px"><br></p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">As you can see from the next image you&#39;re looking to a Visually associated alpha image even if it is not really.</p>

<p dir="ltr"><font face="arial, sans-serif"><a href="https://lh4.googleusercontent.com/-E3QP6SAS9TE/Uz_wFwk9HyI/AAAAAAAAI30/CeDw2snn6Jk/w1016-h812-no/visually.png" target="_blank">https://lh4.googleusercontent.com/-E3QP6SAS9TE/Uz_wFwk9HyI/AAAAAAAAI30/CeDw2snn6Jk/w1016-h812-no/visually.png</a></font><br>



</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px"><br></p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">Here comes all my erroneous thought because as soon as I looked at that image I was driven to think it was correctly premultiplied but it was not!<br>



</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">Then once plugged it in the alpha over the image again looked visually correct.</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:small"><a href="https://lh5.googleusercontent.com/-0XvpRceiXx8/Uz_wF7EvhxI/AAAAAAAAI30/6LmwOsQlOhE/w957-h807-no/over.png" target="_blank">https://lh5.googleusercontent.com/-0XvpRceiXx8/Uz_wF7EvhxI/AAAAAAAAI30/6LmwOsQlOhE/w957-h807-no/over.png</a></span><br>



</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px"><br></p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">As soon as I started editing the alpha value the errors in the tree become evident... But since the image looked premultiplied and visually correct I was driven to hundreds of incorrect thought about how the nodes work.</p>

<p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">So here comes my &quot;final&quot; thought:<br>Should unassociated images be properly showed in that display mode?</p><p dir="ltr" style="font-family:arial,sans-serif;font-size:13px">



<br></p><p style="font-family:arial,sans-serif;font-size:13px">Thanks</p><p style="font-family:arial,sans-serif;font-size:13px">Francesco</p></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-04 17:53 GMT+02:00 Lukas Tönne <span dir="ltr">&lt;<a href="mailto:lukas.toenne@gmail.com" target="_blank">lukas.toenne@gmail.com</a>&gt;</span>:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The RGBA separate and combine nodes are fine IMO, they work just as expected. What could be useful would be to extend the &quot;Set Alpha&quot; node with an optional setting to handle premultiplication.<div>




<br></div><div>As discussed on IRC what happens is that, when replacing the alpha component (either by &quot;combine rgb&quot; or &quot;set alpha&quot;), the rgb color components are still premultiplied with the old alpha value, thus giving an incorrect resulting associated color value.</div>




<div><br></div><div>input color: (r,g,b,a) = (R*a, B*a, G*a, a), where (R,G,B) is the &quot;original&quot; unassociated color value</div><div>replacing alpha: (r,g,b,a&#39;) = (R*a, B*a, G*a, a&#39;) i.e. the resulting color uses a wrong alpha factor for premul</div>




<div>desired result: (r&#39;,g&#39;,b&#39;,a&#39;) = (R*a&#39;, G*a&#39;, B*a&#39;, a&#39;)<br></div><div><br></div><div>Here&#39;s an example file that contains a node group which correctly replaces rgb along with alpha to the desired premultiplied color:</div>




<div><a href="http://www.pasteall.org/blend/28164" target="_blank">http://www.pasteall.org/blend/28164</a><br></div><div><br></div><div>This node group would be the alternative &quot;Set Alpha&quot; implementation when the proposed &quot;premul&quot; option is enabled.</div>




</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 4:45 PM, Francesco Paglia <span dir="ltr">&lt;<a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">After a discussion on blendercoders I understood why I had to add the premult node at the beginning and at the end of my nodetree.<div>




<br></div><div>The fact is that combine and separate rgba do not take into account any property of the input.</div>

<div>The separate don&#39;t know if an input have associated or unassociated alpha and the combine strictly act as a &quot;container of independent channels&quot; that have to be further recombined.</div><div>This drive to the need of unassociate the alpha at the beginning of the tree and to reassociate it at the end of the modification of the alpha channel to make it properly working.</div>






<div><br></div><div>I got confused because after combining the channels previously separated I have not get any of the result I could expect but an image equal to the original...  </div><div>Here what I could expect:</div>






<div><br></div><div>1° the correct image with a lower alpha intensity </div><div>2° an image with a lower alpha and black artifact</div><div>3° a fully opaque rgb image (equal to the orginal but with black color where the alpha should be) with an unassociated alpha</div>






<div><br></div><div>Since non of those result came up to me I started thinking in a wrong way that lead me to write the original post.</div><div>After a bit of discussion most of the question have been solved but after further thinking and with the discussion in mind I&#39;m even more convinced that with my setup I should have get the third result.</div>






<div><br></div><div>I think there&#39;s still some issue in the combine rgba node.</div><div>   </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-04 14:37 GMT+02:00 Francesco Paglia <span dir="ltr">&lt;<a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a>&gt;</span>:<div>




<div><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Ton,<div>let me say I used the term Fade because I was used to it coming from other Compositing packages.</div>






<div>I mean the value of a pixel of a channel multiplied by another value should output the result of the multiplication .</div>
<div>Alpha over comes later... after this operation!</div><div><br></div><div>I think an image would explain much more than 100 words especially if my jargon isn&#39;t really appropriate :)</div><div><br></div><div><a href="https://lh4.googleusercontent.com/-f-dm0O5h_qs/Uz6nQz4s9qI/AAAAAAAAI14/CsFT1RmOzmw/w1358-h309-no/noprem.png" target="_blank">https://lh4.googleusercontent.com/-f-dm0O5h_qs/Uz6nQz4s9qI/AAAAAAAAI14/CsFT1RmOzmw/w1358-h309-no/noprem.png</a><br>







</div><div> </div><div>  </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-04 13:45 GMT+02:00 Ton Roosendaal <span dir="ltr">&lt;<a href="mailto:ton@blender.org" target="_blank">ton@blender.org</a>&gt;</span>:<div>






<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
&quot;Fade&quot; can mean too many things.<br>
You mean: &quot;Image should become transparent - during an alpha-over operation&quot;?<br>
<br>
Well to start with - such effects look much different in linear, than in non-linear spaces.<br>
<br>
And realize: premultiplied RGBA = alpha should not be changed. Not!<br>
Straight alpha - yes, that you can do with what you like.<br>
<br>
-Ton-<br>
<br>
--------------------------------------------------------<br>
Ton Roosendaal  -  <a href="mailto:ton@blender.org" target="_blank">ton@blender.org</a>   -   <a href="http://www.blender.org/" target="_blank">www.blender.org</a><br>
Chairman Blender Foundation - Producer Blender Institute<br>
Entrepotdok 57A  -  1018AD Amsterdam  -  The Netherlands<br>
<div><br>
<br>
<br>
On 4 Apr, 2014, at 13:25, Francesco Paglia wrote:<br>
<br>
&gt; Hi, hope I used a right title for this topic.<br>
&gt; I&#39;ve just setup a simple nodegroup to make a fade node.<br>
&gt; Here the tree:<br>
&gt;<br>
&gt; <a href="https://lh4.googleusercontent.com/-Mos7IL6bx4E/Uz6VHnKqZ3I/AAAAAAAAI1U/zJJ7zOFnRWQ/w1176-h368-no/fade_nodesetup.png" target="_blank">https://lh4.googleusercontent.com/-Mos7IL6bx4E/Uz6VHnKqZ3I/AAAAAAAAI1U/zJJ7zOFnRWQ/w1176-h368-no/fade_nodesetup.png</a><br>








&gt;<br>
&gt; As input of this group I&#39;ve a renderlayer, if I&#39;m not wrong the compositor works with a linear workflow so why I have to add make alpha straight at the beginning and a premultiply at the end to make it working properly?<br>








&gt;<br>
&gt; Thanks for your help<br>
&gt; Francesco<br>
&gt;<br>
&gt; --<br>
&gt; Francesco Paglia<br>
&gt; Vfx and Production Supervisor<br>
&gt;<br>
&gt; mobile  <a href="tel:%2B39%20347.82.12.473" value="+393478212473" target="_blank">+39 347.82.12.473</a><br>
&gt; e-mail   <a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a><br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; Bf-compositor mailing list<br>
&gt; <a href="mailto:Bf-compositor@blender.org" target="_blank">Bf-compositor@blender.org</a><br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>
<br>
_______________________________________________<br>
Bf-compositor mailing list<br>
<a href="mailto:Bf-compositor@blender.org" target="_blank">Bf-compositor@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>
</blockquote></div></div></div><div><br><br clear="all"><div><br></div>-- <br>Francesco Paglia<div>Vfx and Production Supervisor</div><div><br></div><div>mobile  <a href="tel:%2B39%20347.82.12.473" value="+393478212473" target="_blank">+39 347.82.12.473</a></div>






<div><div>e-mail   <a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a></div>
</div><div><br></div>
</div></div>
</blockquote></div></div></div><div><br><br clear="all"><div><br></div>-- <br>Francesco Paglia<div>Vfx and Production Supervisor</div><div><br></div><div>mobile  <a href="tel:%2B39%20347.82.12.473" value="+393478212473" target="_blank">+39 347.82.12.473</a></div>




<div><div>e-mail   <a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a></div>

</div><div><br></div>
</div></div>
<br>_______________________________________________<br>
Bf-compositor mailing list<br>
<a href="mailto:Bf-compositor@blender.org" target="_blank">Bf-compositor@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Bf-compositor mailing list<br>
<a href="mailto:Bf-compositor@blender.org" target="_blank">Bf-compositor@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Francesco Paglia<div>Vfx and Production Supervisor</div><div><br></div><div>mobile  <a href="tel:%2B39%20347.82.12.473" value="+393478212473" target="_blank">+39 347.82.12.473</a></div>

<div><div>e-mail   <a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a></div>

</div><div><br></div>
</div>
_______________________________________________<br>Bf-compositor mailing list<br><a href="mailto:Bf-compositor@blender.org" target="_blank">Bf-compositor@blender.org</a><br><a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>

</blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
Bf-compositor mailing list<br>
<a href="mailto:Bf-compositor@blender.org">Bf-compositor@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-compositor" target="_blank">http://lists.blender.org/mailman/listinfo/bf-compositor</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Francesco Paglia<div>Vfx and Production Supervisor</div><div><br></div><div>mobile  +39 347.82.12.473</div><div><div>e-mail   <a href="mailto:f.paglia.80@gmail.com" target="_blank">f.paglia.80@gmail.com</a></div>

</div><div><br></div>
</div>