Skip to content

Instantly share code, notes, and snippets.

@esimov
Created July 6, 2022 08:45
Show Gist options
  • Save esimov/e412a659cd9e12db2e483899137751e9 to your computer and use it in GitHub Desktop.
Save esimov/e412a659cd9e12db2e483899137751e9 to your computer and use it in GitHub Desktop.
uint8Arr := js.Global().Get("Uint8Array").New(width * height * 4)
js.CopyBytesToJS(uint8Arr2, pixels.ImgToPix(blurred))
uint8Clamped := js.Global().Get("Uint8ClampedArray").New(uint8Arr2)
rawData := js.Global().Get("ImageData").New(uint8Clamped, width, height)
c.ctx.Call("putImageData", rawData, 0, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment