View Single Post
Old 13th October 2018, 20:16   #65  |  Link
Soulnight
Registered User
 
Join Date: Jan 2017
Location: Germany
Posts: 21
Hello!

thank you for creating this tool.

I am trying to do a small experiment with hdr rec2020 content to display in a certain color the pixels having colors outside REC709 colorspace.

I thought I would have to:

1) first convert from YUV to RGB.
2) Then convert non linear RGB to Linear RGB
3) Multiply by the matrix to go from REC2020 to REC709 colorspace

At 3), I though, I should then tell what to do with RGB values outsides the legal range and specify their value.

Like:

Code:
= decodeTransferFunction(sourcePixel); float3 rgb709 = mul(rgb2020, float3x3(...)); float3 result; if ((rgb709.r < 0.0) || (rgb709.r > 1.0) || (rgb709.g < 0.0) || (rgb709.g > 1.0) || (rgb709.b < 0.0) || (rgb709.b > 1.0)) result = 1.0; else result = 0.0;
But I don't know how to do that in Avisynth.

I currently have that code:

Code:
loadplugin("C:\Users\flole\Downloads\ManualColorMatrix\ManualColorMatrix_26.dll")
loadplugin("C:\Users\flole\Videos\AviSynth\HDRTools\x86\Release_W7\HDRTools.dll")
Directshowsource("F:\Kodi\Demo 4k HDR\The World In HDR 4K Demo.mkv")
ConvertYUVtoLinearRGB(Color=1)
#isRGB()
ManualColorMatrix(1, 1.66049, -0.58764, -0.07285, -0.12455, 1.13290, -0.00835, -0.01815, -0.10058, 1.11873)
Does the function you have written directly combined step 1 and 2?
ConvertYUVtoLinearRGB(Color=1)

Thank you, Merci beaucoup.
Florian

ps:
Final goal will be to visualize what color are "extended" and outside the REC709 color space.
And then analyse a full movie to get a % of pixels and frames showing colors outside the REC709 range.
And then if possible, even say how far and saturated are those colors for different Hue (RED, green, etc).

Last edited by Soulnight; 13th October 2018 at 20:20.
Soulnight is offline   Reply With Quote