Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 14th August 2019, 21:37   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
HDRTools vs DitherTools vs ColorMatrix

Would any interested parties care to look at this comparison of color conversion methods? The ColorMatrix version used is this one.

Edit: For anyone reading this thread, HDRTools was getting the XYZ rec.2020 color conversions correct. Using that method it also converts the color primaries which produce a very different result. The banding problems I think I mentioned at some stage are due to an 8 bit video limitation. HDRTools doesn't cause banding if you use Avisynth+ and convert the video to 16 bit first. The rest of what I didn't understand when starting this thread is explained in post #19 and #20, as is why I think ColorMatrix 2.6 shouldn't be used for rec.2020 conversions. Aside from the fact it outputs the same colors as the source when converting between rec.2020 and rec.601, rather than outputting an error message because it doesn't support conversions between rec.2020 and rec.601, I'm still pretty sure it's rec.2020 to rec.709 conversion is incorrect, and it doesn't convert the color primaries either (neither does DitherTools).

There's a bunch of screenshots to go with the tests below. I won't post them here as there's quite a few, but if you follow the link you'll find a gallery and the screenshots are properly named so as to easily see what they represent. Included is a screenshot of how much the images sizes vary after compression to PNG. The biggest changes are the DitherTools images which I suppose must be the result of dithering. The source is animation so there's large areas of single color to make the differences easy to see.
https://postimg.cc/gallery/1r9z2a760/

All testing was done using classic Avisynth on XP, although a quick look indicates nothing changes for Avisynth+.
The source video is HD, downscaled to SD, the various color conversions applied, and the screenshots taken by opening the script with MPC-HC. If I'm doing something wrong I'm happy to learn. Comments welcome!

Rec.709 To Rec.601
All conversion methods seem to agree.
HDRTools Linear looks better than HDRTools XYZ (no banding).

HDRTools XYZ
ConvertYUVtoXYZ(Color=2).ConvertXYZtoYUV(Color=3, pColor=2, OutputMode=2)
HDRTools Linear
ConvertYUVtoLinearRGB(Color=2).ConvertLinearRGBtoYUV(Color=3, OutputMode=2)
DitherTools
Dither_convert_yuv_to_rgb(matrix="709", slice=false).Dither_convert_rgb_to_yuv(matrix="601", output="YV12")
ColorMatrix
ColorMatrix(mode="Rec.709->Rec.601", clamp=0)

Rec.2020 To Rec.601
DitherTools and HDRTools Linear apparently agree.
ColorMatrix is different.
HDRTools XYZ seems borked or I don't know what I'm doing.

HDRTools XYZ
ConvertYUVtoXYZ(Color=1).ConvertXYZtoYUV(Color=3, pColor=1, OutputMode=2)
HDRTools Linear
ConvertYUVtoLinearRGB(Color=1).ConvertLinearRGBtoYUV(Color=3, OutputMode=2)
DitherTools
Dither_convert_yuv_to_rgb(matrix="2020", slice=false).Dither_convert_rgb_to_yuv(matrix="601", output="YV12")
ColorMatrix
ColorMatrix(mode="Rec.2020->Rec.601", clamp=0)

Rec.2020 To 709
I'd only be guessing as nobody agrees.
DitherTools and HDRTools Linear possibly only disagree for "red".
I think ColorMatrix is wrong.
HDRTools XYZ seems borked or I don't know what I'm doing.

HDRTools XYZ
HDRToolsConvertYUVtoXYZ(Color=1).ConvertXYZtoYUV(Color=2, pColor=1, OutputMode=2)
HDRTools Linear
ConvertYUVtoLinearRGB(Color=1).ConvertLinearRGBtoYUV(Color=2, OutputMode=2)
DitherTools
Dither_convert_yuv_to_rgb(matrix="2020", slice=false).Dither_convert_rgb_to_yuv(matrix="709", output="YV12")
ColorMatrix
ColorMatrix(mode="Rec.2020->Rec.709", clamp=0)


Anyone know what the difference between the HDRTools two flavours of Rec.601 might be (BT601_525 & BT601_625)?
When I do this, there's appears to be a difference, unless it's just the conversion and not a color difference,

A = last
B = ConvertYUVtoXYZ(Color=3).ConvertXYZtoYUV(Color=4, pColor=3, OutputMode=2)
C = ConvertYUVtoLinearRGB(Color=3).ConvertLinearRGBtoYUV(Color=4, OutputMode=2)
Compare(A, B)
or
Compare(A, C)
(these are labelled "HDRTools Compare A&B" and "HDRTools Compare A&C" in the gallery.

Last edited by hello_hello; 28th January 2020 at 21:11.
hello_hello is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.