Bug 191868 - Colours are slightly shifted when using Canvas.captureStream()
Summary: Colours are slightly shifted when using Canvas.captureStream()
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-20 15:33 PST by Adam
Modified: 2022-06-02 05:52 PDT (History)
8 users (show)

See Also:


Attachments
Canvas and Video element with 2 slightly different colours (55.38 KB, image/png)
2018-11-20 15:33 PST, Adam
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam 2018-11-20 15:33:32 PST
Created attachment 355368 [details]
Canvas and Video element with 2 slightly different colours

If you draw on a canvas and use canvas.captureStream the resulting colours in the video are slightly different than the colours on the Canvas. This is also the case a bit in Chrome and Firefox but in Safari it is quite a bit different.

See https://output.jsbin.com/rebesum where a new random colour is drawn every 1 second on both a Canvas and a Video. It's more noticeable with some colours than others.
Comment 1 Radar WebKit Bug Importer 2018-11-20 18:42:52 PST
<rdar://problem/46193273>
Comment 2 Ahmad Saleem 2022-06-02 05:52:19 PDT
I think there is no more color shift in the attached JSBin test case in Safari 15.5 on macOS 12.4.

As for matching with other browsers, Chrome Canary 104 does not show <video> element at all while Firefox 104 just shows static colour for <video> tag, which becomes out of sync with <canvas> element.

I am not sure what is correct behavior according to spec but this is the latest update. Thanks!