From bc96b23ef686d29efe95d54a4fd1836c177d7a61 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 24 Jul 2023 23:45:31 +0200 Subject: [PATCH] video_writer: fix gamma for YUV screenshots reproduction steps: take any lossy WebP screenshot and check the colors (or JPEG without libjpeg support, or AVIF with tag-colorspace=no) fixes: 6d9e72cd89652aaf73fa5a8256c439221e86b94a --- video/image_writer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/image_writer.c b/video/image_writer.c index dff7ac58de..ba1afc4cc3 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -633,9 +633,9 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt, mp_image_params_guess_csp(&p); if (!image_writer_flexible_csp(opts)) { - // Formats that don't support non-sRGB csps should be forced to sRGB + // If our format can't tag csps, set something sane p.color.primaries = MP_CSP_PRIM_BT_709; - p.color.gamma = MP_CSP_TRC_SRGB; + p.color.gamma = MP_CSP_TRC_AUTO; p.color.light = MP_CSP_LIGHT_DISPLAY; p.color.sig_peak = 0; if (p.color.space != MP_CSP_RGB) {