[Bf-committers] Is alpha within Blender totally broken?
Ton Roosendaal
ton at blender.org
Sun Jul 17 19:34:10 CEST 2011
Hi Troy,
The issue you have is a combination of several issues; as others wrote
as replies already, we have things reasonably OK work internally, but
when it gets to colormanagement and file saving things get fuzzier.
It's been noted on our todo wiki in many places that both
'colormanagement' (now only gamma correction) as our alpha methods
need to be improved:
- Support both premul as straight alpha internally.
Some operations work best with premul, others with straight...
especially color operations like gamma or RGB curves make premul fail
easily. Internally in Blender, only premul is supported now.
- Color management code currently only corrects rgb, but leaves alpha
unaltered. That gives bad 24 bits gfx for premul alpha.
- File formats can also hardcode define alpha types (premul or
straight). Blender just saves the data as you deliver it. You can save
ot premul-png for example, which is 'forbidden'. Of course Blender
should save out correct pngs by default, but I'd rather fix our
internal alpha methods then too.
So yes... there's work to do here! :)
However, if you'd export EXR to nuke, saved with ColorManagement on,
it should all be fine.
-Ton-
------------------------------------------------------------------------
Ton Roosendaal Blender Foundation ton at blender.org www.blender.org
Blender Institute Entrepotdok 57A 1018AD Amsterdam The Netherlands
On 16 Jul, 2011, at 23:37, Troy Sobotka wrote:
> So far, I've been experimenting with several files and uptake tools
> using Blender in conjunction with Nuke. I have yet to be able to find
> a pattern that delivers proper alpha channels.Perhaps someone here can
> shed some light on the matter.
>
> It has been noted before that there has been some mishandling of alpha
> with regards to all of the non linear output formats such as TIFF,
> PNG, etc. However, upon testing quite extensively with EXR, I am still
> struggling to see a proper use case currently.
>
> I have experimented with the following four combinations:
>
> CM ON - Straight Alpha
> CM OFF - Straight Alpha
> CM ON - Premul Alpha
> CM OFF - Straight Alpha
>
> In all of the instances, there is significant darkening or lightening
> near the edges, suggesting something is wrong. When ingested into
> Nuke, the results are equally confusing.
>
> I hope that someone can shed some light on the issue, as it is
> worrying. The same impacts can be noted when we use blurs, only they
> are augmented by a greater region of disparity where the alpha blurs
> occur.
>
> The following images are direct output from Nuke with proper premul
> settings where appropriate. The same issues appear in other image
> editors and different file formats. In this instance, the tests were
> conducted with EXR output files saved with RGBA.
>
> CM ON - Straight - http://img228.imageshack.us/img228/1639/cmonstraight.jpg
> CM OFF - Straight - http://img43.imageshack.us/img43/3961/cmoffstraight.jpg
> CM ON - Premul - http://img687.imageshack.us/img687/8082/
> cmonpremul.jpg
> CM OFF - Premul - http://img194.imageshack.us/img194/6276/cmoffpremul.jpg
>
> The concern I have is that I believe Blender is mishandling alpha
> channels in all instances. This is partially obscured by the fact that
> whatever technique is being used to encode it is also being used to
> decode it. In some instances, the alpha channel effects are also
> difficult to notice, as it is subject to the size of the alpha region
> and the nature of the background.
>
> In the above tests we can clearly see the darkening over the magenta
> region near the antialiased alpha edges. This can be far more greatly
> seen when we execute a blur.
>
> I have done some testing with gamma adjustments on the alphas to try
> and rectify the situation, believing that it may be because of a log
> to lin or vice versa error, to no avail. Premul also doesn't seem to
> impact the results and solve the problems.
>
> Here is to hoping someone can lend some thought to the issues at hand.
>
> With respect,
> TJS
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
More information about the Bf-committers
mailing list