Repository navigation
Stop the loupe magnifying the wrong colours - #4
Merged
Merged
Conversation
texImage2D on a video element makes the engine do its own YUV to RGB conversion, and it gets it wrong: 39/255 on Safari with a VP8 screen share, 4/255 on Chromium H.264. Measured against a live WebRTC stream on Chromium, real Firefox and real Safari. The loupe is a colour inspection instrument, so it was quietly lying about the footage. An ImageBitmap through the identical pipeline is exact on every engine. Same shader, same format, same readback, only the source changes. UNPACK_COLORSPACE_CONVERSION_WEBGL does not move the number at all. createImageBitmap is async, which suits a texture already throttled to CONTENT_MS: freshness lags a refresh, tracking does not. The first upload stays synchronous so the lens is never blank. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while closing the watermarking colour gate. Predates that work.
LoupeOverlay.svelteuploaded the video element straight into WebGL, which makes the engine do its own YUV to RGB conversion. It gets it wrong by up to 39/255 on Safari with a VP8 screen share, 4/255 on Chromium H.264. A colour inspection instrument was lying about the footage.Uploading an ImageBitmap through the identical pipeline is 0/255 on every engine. Only the upload source changes.
UNPACK_COLORSPACE_CONVERSION_WEBGL = NONEdoes not help at all.Measured against a live WebRTC stream on Chromium, real Firefox (WebDriver BiDi) and real Safari 26.5.2 (safaridriver), with the codec pinned to what the SFU negotiates. Numbers and method in docs/COLOR_PARITY.md.
Not changed: videoGlass's video-element fallback is off by the same amount, but it is frosted and decorative. Scopes already sample through an ImageBitmap and measure exact.
Gate: svelte-check, vitest, npm run build pass. iOS unmeasured.