Jump to content

Combining RGB from one texture with alpha from another


mateuszduda
 Share

Recommended Posts

Hi,

I need help to discuss an issue about merging together two defferent textures - one contains RGB data and is in JPG format, another contains only information about the alpha channel and is in PNG format. We now use an approach where a canvas element is created, the we first draw the alpha texture and use "source-in" composite operation (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation) to draw RGB texture on top.

Due to an error with Apple devices, when creating multiple canvas elements one of them is returned as undefined. Is there any way I can combine these textures while not using a canvas?

I prepared a simple demonstration of the process here: https://playcode.io/1734929

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...