Screenshot color isn't consistent with displayed color
@haasn is already working on this.
Since Jun 18, 2020.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Important Information
- ae5ac7e90a96c02f66b3eb5b63ed960bfffa3fdb
- macOS 10.15.5
- Local mpv build
Reproduction steps
- Take a screenshot of some particularly vibrant content
- View the screenshot in a different application
Expected behavior
- Screenshot colors match displayed video
Actual behavior
- Screenshot colors appear muted, apparently due to gamma error
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:
- mpv displays all 3 identically (and also identically to the original video); I'm not entirely sure why that is and it seems like it might indicate a bug in the handling of the untagged image
- Firefox displays the tagged screenshot identically to the OS screenshot, and the untagged screenshot differently
- Safari, Chrome, macOS Preview, and macOS Quick Look display the tagged and untagged screenshots identically, and the OS screenshot differently
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 to no 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.