You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Inline screenshot preview is washed out when downscaled (linear values re-encoded as sRGB) #1328
When manage_camera(action="screenshot", include_image=true) has to downscale the preview (i.e. max_resolution is lower than the Game View resolution), the returned inline image comes back visibly washed out – dark surfaces are lifted by roughly a gamma step. The PNG written to disk is correct; only the inline copy is affected.
The numbers match a linear→sRGB double-conversion: a UI color of rgb(11,16,21) arrives as ≈rgb(60,72,80), and 1.055 * (11/255)^(1/2.4) - 0.055 ≈ 0.236 → 60. So it looks like the resize path treats already-encoded sRGB bytes as linear (or resizes in linear and never converts back).
This is not cosmetic for agent workflows: an LLM client judging UI colors from the inline preview will "fix" colors that were never broken. In our case the map fog ended up twice as saturated as the design before we caught it.
Reproduction steps
Project: URP, color space = Linear, Game View 1920×1080.
Display any dark UI (ours is a UI Toolkit screen whose background is rgb(11,16,21)).
manage_camera(action="screenshot", include_image=true, max_resolution=1920) – inline preview is correct (no resize needed).
manage_camera(action="screenshot", include_image=true, max_resolution=900) – inline preview is washed out, same frame.
Open either saved PNG and sample the same pixel – both files are correct:
The inline preview should be colorimetrically identical to the saved PNG regardless of max_resolution.
Actual
Downscaled inline previews are lifted by a gamma step; native-resolution previews are fine, and files on disk are always fine.
Notes
Suspected spot: the image-resize step on the server side (resampling in linear light, or Image data being reinterpreted rather than converted before re-encoding).
Activity
fix(screenshot): match downscale RenderTexture color space to the source
fix(screenshot): match downscale RenderTexture color space to the source