Skip to content

Blending issue with multiple ImageGLs #105

@astrofrog

Description

@astrofrog

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions