<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">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 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 class="h5"><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><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></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><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></div>
</blockquote></div></div></div><div><div class="h5"><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></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></div>