canvas icon indicating copy to clipboard operation
canvas copied to clipboard

What is the pixel format?

Open vincaslt opened this issue 10 months ago • 1 comments

I'm using raw canvas data as frames for ffmpeg, and I need to provide the pixel format. I'm assuming it's rgba, but I would like to be sure.

I'm seeing a slight color shift when encoding into YUV420p format, but that might be due to the color space changes, though I would like to rule out my incorrect assumption about what format the canvas is in.

vincaslt avatar Apr 12 '24 17:04 vincaslt

It should be rgba unless you specify the colorSpace attribute in getContext('2d'): https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#colorspace

Brooooooklyn avatar Apr 17 '24 02:04 Brooooooklyn