Status: 

Vuo version: 

Fixed in Vuo version: 

OS version: 

  • Mac OS 10.9

How severely does this bug affect you?: 

●○○○ — Not much; I'm just letting you know about it.

Steps causing the bug to occur: 

[Original title: Bizarre Alpha Behaviour- including saving PNG with Alpha Corrupt]

  1. Make a composition that uses alpha somehow
  2. Simplest way is to use make radial gradient image and set inside to white and outside to transparent
  3. save image with save image
  4. image is corrupt and horrible
  5. Another related issue is that when using either alpha or any other channel in ShaderToy OR GLSL as a knockout channel, (such as: fragColor = vec4(image.rgb, alpha.a) then the output is horrible.

Have you found a workaround?: 

No.

Other notes: 

Discovered that Vuo uses premultiplied alpha. Can we get this written up somewhere? (updated severity to match my fix)

Screenshots: 

Compositions: 

AttachmentSize
Package icon Alpha_Issue.zip666.03 KB

Comments

Just to confirm I can get

alexmitchellmus's picture
Submitted by

Just to confirm I can get ProRes 4444 (with alpha into Vuo) and it composites beautifully. However I have yet to find a method that allows combining custom alpha channels within Vuo itself. Is this a feature request? I don't understand why ProRes 4444 would have its alpha respected- but a shader wouldn't?

UPDATE: fixed my original

alexmitchellmus's picture
Submitted by

UPDATE: fixed my original issue (in respect to replacing alpha from another source). Turns out I was expecting non-pre-multiplied output alpha in Vuo. I changed ShaderToy:

Correct: (premultiplied output)

void main(void)
{
vec2 uv = (gl_FragCoord.xy/iResolution.xy);
vec4 alpha = texture2D(iChannel0, uv);
vec4 image = texture2D(iChannel1, uv);
gl_FragColor = vec4(image.rgb, 1.0)*alpha.a ;
}

Incorrect: (assuming non-premultiplied output)

void main(void)
{
vec2 uv = (gl_FragCoord.xy/iResolution.xy);
vec4 alpha = texture2D(iChannel0, uv);
vec4 image = texture2D(iChannel1, uv);
gl_FragColor = vec4(image.rgb, alpha.a);
}

Still issue with exporting PNG

Discovered that Vuo uses

jstrecker's picture
Submitted by
Status:
Waiting for review by Vuo Support Team
»
Accepted

Sure, we can add info about premultiplied alpha to the docs for Make Image with Shadertoy, the VuoShader type, and Ability to edit GLSL shader code in Vuo Editor.

Besides the lack of documentation, another problem is that, if you use Save Image on a 16bpc image with color values greater than 1 (which would happen if you fail to premultiply), it outputs unexpected colors for those pixels (it wraps them rather than clamping them). I've retitled this bug report accordingly.

alexmitchellmus, in your screenshot, there's a file called "saved_image.png" open in Preview. Would you mind posting the composition that outputs that image? Wondering how to reproduce it.

I will update this post with

alexmitchellmus's picture
Submitted by

I will update this post with comp, but before I forget - does Vuo use both non-premultiplied and premultiplied alpha modes? Because if I create a gradient with an alpha it has an alpha channel- same to if I use a ProRes4444 with alpha. But once I process it there is no longer any image.a associated with the pipeline. (Only image.rgb)

If this is going to be fixed,

alexmitchellmus's picture
Submitted by

If this is going to be fixed, (apart from allowing us to render non-pre-multiplied to PNG) possibly it would be better to not change functionality at all, and simply allow us to see what is the color mode of the output? Such as RGBA / RGB / 8bpc / 16bpc. (in future this may expand to 32 bit, and other color spaces, e.g: HSI, HSL, HSV, Lab, XYZ, YCbCr, YUV)

Here is a comp I made which renders it correctly and the resulting PNG by using pre-multiplying in ShaderToy.

Its a very boring white PNG output (but if you put it into something that is alpha aware its transparent- use Preview or PhotoShop - or even Vuo!)

Sorry in advance for double posting: https://vuo.org/comment/2449#comment-2449 however thats a feature request which happened before I learned about what "this" issue really was. (and I am not sure if its a request or a bug anyway)