Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blending issue with multiple ImageGLs #105

Open
astrofrog opened this issue Jul 11, 2023 · 2 comments
Open

Blending issue with multiple ImageGLs #105

astrofrog opened this issue Jul 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@astrofrog
Copy link
Member

The following notebook demonstrates a bug in the blending of multiple ImageGL marks:

https://gist.github.com/astrofrog/08735bc30c2f8980edeaae0fd0842352

In short, I set up two arrays that look like:

image1 = np.array([[[255, 0, 0, 255], [0, 0, 255, 255]], [[255, 0, 0, 0], [0, 0, 255, 0]]]).astype(np.float32)
image2 = np.array([[[0, 0, 255, 0], [255, 0, 0, 0]], [[0, 0, 255, 255], [255, 0, 0, 255]]]).astype(np.float32)

In both cases the top and bottom row of pixels is the same within the image except that the top row (in the first case) and the bottom row (in the second case) are transparent. If I show the arrays individually I get sensible results:

Screenshot 2023-07-11 at 21 25 42 Screenshot 2023-07-11 at 21 25 48

But if I show the two at the same time the result looks incorrect:

Screenshot 2023-07-11 at 21 25 55

It seems perhaps the alpha compositing is not correctly taking the opacity layer into account. I haven't had a chance to dig into the shader code yet.

@astrofrog astrofrog added the bug Something isn't working label Jul 11, 2023
@pllim
Copy link
Contributor

pllim commented Jul 12, 2023

Does this affect Imviz?

@astrofrog
Copy link
Member Author

Not for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants