-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshot color isn't consistent with displayed color #7840
Comments
So, there are two separate issues here:
Question 1 is the easier to answer. Let me first note that all three images contain the same pixel data, i.e. the only difference is down to metadata. And in terms of that, all three are different:
Note that mpv ignores embedded ICC profiles unless you also have a display ICC profile set, which is probably why 3 renders the same as 1 and 2 for you - it's different on my end! From this we can infer:
I assume that if you use As for why mpv creates the other two files it creates should be rather obvious from just the explanation alone that mpv considers untagged RGB to be sRGB by default, and importantly, these files should also both roundtrip back to the same thing when viewed in mpv (or other software making the same assumption). |
Also, side note, it's worth exploring what happens in the current screenshot code:
And for what it's worth, |
It seems to me as the solution is multitude, and involves fixing all of the following bugs:
|
Heh, yup, this is a laptop with a P3 monitor; I didn't realize mpv displayed incorrectly in that case by default (I thought macOS automatically handled color conversion in the compositor). I guess it was just expanding the BT709 input into a P3 output? Kind of a pity it was wrong, I was kinda fond of that bright shade.
Oddly, I tested in QuickTime and got yet another slightly different result; not sure what's going on here: Wonder if it'd be worth enabling |
For subjective aesthetic reasons it's definitely an effect you can mimick using a custom "gamut expansion" shader. I do agree that saturated colors make anime etc. look very nice, the main three issues afaict are skin tones, grass and sky. Maybe we can develop a shader that tries preserving those three hue types while oversaturating everything else (especially red)? Almost like a sort of "inverse gamut mapping", i.e. mostly linear response with "un-knee" function close to the gamut boundary. |
I would enable it by default on all platforms... |
For the "infinite contrast" warning, re-analyzing this problem I'm not sure if what we're doing currently is even correct. For "perceptual" (black-scaled) profiles, we probably don't want to also be performing contrast scaling in the BT.1886 implementation, so rather than treating it as 1000:1 contrast we should probably treat it more like infinite contrast, either at gamma 2.4 or possibly at gamma 2.2? (Or indeed, the dreaded 1.961!) I unfortunately don't have any perceptual profiles to test with, so I can't say what preserves the overall intent the best, end-to-end. Feel free to open a new issue for that. Maybe I can get around to dusting off my colorimeter and improving the status quo of perceptual profile support. It would be nice if apple shipped both perceptual and colorimetric profiles for their displays, or something.. |
In my case (macOS 14.2.1), screenshots match mpv's display with Update: But I feel like the display is over-saturated in dark scenes. |
Important Information
Reproduction steps
Expected behavior
Actual behavior
Log file
mpv-tagged-screenshot-output.txt
Sample files
mpv screenshot taken with
screenshot-tag-colorspace=yes
:mpv screenshot taken with
screenshot-tag-colorspace=no
:(Both taken with
zimg-fast=no
, though I'm not sure if it matters currently)OS-level screenshot:
The issue is most clearly visible in the bright red areas in this screenshot (particularly the hair).
Test results with these 3 images:
The tagged image can be used as a sample file to take additional screenshots of, amusingly enough; the behavior is identical to using the original source file, so I don't think there's any need for me to upload a separate sample.
I think the problem here is that screenshots are being saved with the original video gamma, and most applications expect sRGB gamma. Some (e.g. Firefox) support tagged gamma, but it's not widespread enough to rely on that (which is why
screenshot-tag-colorspace
was set tono
by default in the first place). I've been poking around trying to get mpv to convert to sRGB gamma when taking screenshots, but I haven't had any luck so far; not entirely sure what's going wrong.Assigning @haasn for (hopefully) some more expertise on the intricacies here.
The text was updated successfully, but these errors were encountered: