Created
November 25, 2019 03:39
-
-
Save guest271314/db0bf90e4c9773bdcda9a3c92ba148c6 to your computer and use it in GitHub Desktop.
Convert OffscreenCanvas to ImageData using png.js (OffscreenCanvasRenderingContext2D not implemented at Firefox 70 or Nightly 72)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const imageData = new ImageData( | |
new Uint8ClampedArray( | |
new PNG(new Uint8Array(await (await offscreen.toBlob({type: "image/png"})).arrayBuffer())).decodePixels() | |
) | |
, offscreen.width, offscreen.height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment