Log in

View Full Version : Chromaticity diagram


leoenc
13th February 2022, 17:17
Hi

Does anyone know of a tool, preferably a filter for avisynth or ffmpeg, that can analyze and build a CIE 1931 chromaticity diagram from a video file?

I would like to verify that a video indeed uses the color space stated in its metadata.

Selur
13th February 2022, 21:54
Searching in the ffmpeg filter documentation -> https://ffmpeg.org/ffmpeg-filters.html#ciescope

richardpl
14th February 2022, 09:07
I'm really puzzled, how you are supposed to know what real color space is in video, when video does not use XYZ pixel format from beginning.

Selur
14th February 2022, 09:45
https://github.com/Lypheo/Color-Tools for VapourSynth might also work. (sadly no binary)

leoenc
15th February 2022, 17:22
@Selur Thank you very much, I will look into both these options.
@richardpl I don't. I was thinking that a chromaticity diagram would allow me to visually estimate what color range the video is using. Hopefully, if I was to use the ffmpeg ciescope filter on an HDR file, I would set the color system to rec2020 and roughly compare the resulting triangle with a correct rec2020 diagram.

wswartzendruber
15th February 2022, 17:48
Hi

I would like to verify that a video indeed uses the color space stated in its metadata.
It sounds like you want to use that color space's primary coefficients, convert to XYZ, and then look at the output to see if it makes sense.

I would think that creative intent would throw that sort of assessment off completely. While this might work for The Avengers, it likely won't work for Zack Snyder's Justice League.

leoenc
16th February 2022, 07:43
[QUOTE=wswartzendruber;1963999]It sounds like you want to use that color space's primary coefficients, convert to XYZ, and then look at the output to see if it makes sense.

So, if I understand correctly, I could feed an HDR video with AVS ConvertYUVtoXYZ into ffmpeg's ciescope filter.

richardpl
16th February 2022, 09:09
You could see real gamut of video only and only if input to filter is in XYZ colorspace.

leoenc
16th February 2022, 09:20
You could see real gamut of video only and only if input to filter is in XYZ colorspace.

So if I'm using ConvertYUVtoXYZ, input to ciescope filter should be in XYZ colorspace.

wswartzendruber
16th February 2022, 16:55
So if I'm using ConvertYUVtoXYZ, input to ciescope filter should be in XYZ colorspace.
In theory, this should work. Make sure the ConvertYUVtoXYZ function is aware of the primary coefficients of the source colorspace. Obviously, ciescope must expect XYZ input.

wswartzendruber
17th February 2022, 17:57
Remember, though, that creative intent can throw this sort of thing off:

https://th.bing.com/th/id/R.1cbedb85c00c5297ad72a34895f1aa5b?rik=yTQTjfEPtEUKZA&riu=http%3a%2f%2ftheactionelite.com%2fwp-content%2fuploads%2f2021%2f03%2fzack-snyder-s-justice-league-review-1200.jpg&ehk=NhBUPkFPwVevqg7%2fDvFST0bGkLOzYSfWrmF3zmC5vCQ%3d&risl=&pid=ImgRaw&r=0