Skip to content
Discussion options

You must be logged in to vote

For your first example, through the canvas. The issue is the canvas premultiplies values

The value in the file you were checking is 130 101 73 1. That value gets premultiplied when put in the canvas so it becomes 1 1 1 1. It's then un-premultiplied when you call getImageData, the result is 255 255 255 1.

For your second example you can't use copyExternalImageToTexture unless you set the RENDER_ATTACHMENT usage. You should have gotten an error.

With that added it works for me

https://jsgist.org/?src=e9261816382d2637f29e8e7f105c1c40

It's strange that you saw 255, 255, 255, 1 because since it failed you should have gotten 0,0,0,0 (which is what I got before I added RENDER_ATTACHMENT usage.

Y…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@greggman
Comment options

@greggman
Comment options

@greggman
Comment options

@greggman
Comment options

Answer selected by juj
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants