Log in

View Full Version : ColorMatrix v2.6 supports Rec.2020


leiming2006
22nd February 2018, 09:27
Hello, the original ColorMatrix plugin has no Rec.2020 matrix support.
There seems to be needs to convert Rec.2020 to Rec.709 for compatibility purpose.

I'm not sensitive to incorrect color. Could someone help me to confirm if it's correct?

colormatrix.dll download:
https://github.com/sorayuki/ColorMatrix/releases/tag/v2.6
( colormatrix_v2_6.zip contains colormatrix.dll )

source code:
https://github.com/sorayuki/ColorMatrix

original one: https://forum.doom9.org/showthread.php?t=81875
colormatrix v2.5: included in avisynth documentation

Sparktank
22nd February 2018, 11:21
TBH, colormatrix support could have more documentation since the new-age of UHD and AVS+/VS.

I've just been using either Dither_Package (stacked16) or z.lib to convert colormatrix for FHD/UHD in AVS+.

But, with Z.Lib, it helps to look at the source code to see the compatible calls required for the colormatrix/transfer/etc:
https://forum.doom9.org/showthread.php?t=173986

That's how I do colormatrix in x64.

leiming2006
22nd February 2018, 15:47
TBH, colormatrix support could have more documentation since the new-age of UHD and AVS+/VS.

I've just been using either Dither_Package (stacked16) or z.lib to convert colormatrix for FHD/UHD in AVS+.

But, with Z.Lib, it helps to look at the source code to see the compatible calls required for the colormatrix/transfer/etc:
https://forum.doom9.org/showthread.php?t=173986

That's how I do colormatrix in x64.

First time heard of the interesting z.lib library.
It seems that I haven't get in touch with AviSynth users and only knowing the outdated ColorMatrix plugin...

leiming2006
23rd February 2018, 03:34
TBH, colormatrix support could have more documentation since the new-age of UHD and AVS+/VS.

I've just been using either Dither_Package (stacked16) or z.lib to convert colormatrix for FHD/UHD in AVS+.

But, with Z.Lib, it helps to look at the source code to see the compatible calls required for the colormatrix/transfer/etc:
https://forum.doom9.org/showthread.php?t=173986

That's how I do colormatrix in x64.

Hello, I tried the Z.lib plugin for AVS with this statement:
z_ConvertFormat(colorspace_op="2020:st2084:2020:limited=>709:709:709:limited", pixel_type="YV12", dither_type="none")
It runs rather slow. Is there something wrong with my arguments?

Sparktank
23rd February 2018, 19:39
Hello, I tried the Z.lib plugin for AVS with this statement:
z_ConvertFormat(colorspace_op="2020:st2084:2020:limited=>709:709:709:limited", pixel_type="YV12", dither_type="none")
It runs rather slow. Is there something wrong with my arguments?

That looks correct.

Not sure why it would be slow.

kedautinh12
23rd January 2020, 04:02
I see incorrect in this post
https://forum.doom9.org/showthread.php?p=1882362#post1882362

leiming2006
10th April 2020, 18:49
I see incorrect in this post
https://forum.doom9.org/showthread.php?p=1882362#post1882362

I have no enough knowledge towards HDR; possible I can't handle it.

It may be a good idea to move to zimg? It produces right result convert BT.2020 (HDR) to BT.709 (SDR)

It has been quite a long time since I tried this ( https://forum.doom9.org/showthread.php?t=173986 ), and I even got test materials lost... Not sure if still suffers performance issue in my computer.

library: https://github.com/sekrit-twc/zimg

almosely
1st May 2020, 15:57
Hi,

I am using AviSynth+ 3.5.1 (x64), but since a few months ago, colormatrix is causing crashes of the MPC-HC media player (x64), while controlling the settings out of AvsPmod (x64). Recently I noticed, that there are updates for the MPC-HC at GitHub (https://github.com/clsid2/mpc-hc/releases) (last version 1.9.2 from 23. March 2020; I just exchanged the whole MPC-HC folder of my existing old version, since there is no documentation about installing/updating MPC-HC), but colormatrix is not working with that version either; but something has changed: with the old MPC-HC version (1.7.13 from 16. july 2017), MPC-HC just crashes, while with the new version, MPC-HC spits out an error message about an access violation of the colormatrix-thread at some memory adress. Colormatrix (x64) is working fine within AvsPmod and Simple x264 Launcher (using x264 64-bit), but wether I try it out of AvsPmod or straight out of the windows explorer (Windows 10 x64), MPC-HC crashes. I think, is has something to do with recent updates of windows or some visual c++ libraries - just a feeling. So, my questions are: Could you compile a x64-version of your colormatrix-version, so I can try, if that works (there's no need for BT.2020 for me, btw.)? Colormatrix is working absolutely fine with AVS+ (x64) (multi- and single threaded), as explained here (http://forum.doom9.net/showthread.php?p=1865335).

I use colormatrix quite a lot for documentations, series and movies without visual features (comedies, intimate theater ...), which I re-encode to SD anamorph (mostly 16:11).

kedautinh12
1st May 2020, 18:51
Hi,

I am using AviSynth+ 3.5.1 (x64), but since a few months ago, colormatrix is causing crashes of the MPC-HC media player (x64), while controlling the settings out of AvsPmod (x64). Recently I noticed, that there are updates for the MPC-HC at GitHub (https://github.com/clsid2/mpc-hc/releases) (last version 1.9.2 from 23. March 2020; I just exchanged the whole MPC-HC folder of my existing old version, since there is no documentation about installing/updating MPC-HC), but colormatrix is not working with that version either; but something has changed: with the old MPC-HC version (1.7.13 from 16. july 2017), MPC-HC just crashes, while with the new version, MPC-HC spits out an error message about an access violation of the colormatrix-thread at some memory adress. Colormatrix (x64) is working fine within AvsPmod and Simple x264 Launcher (using x264 64-bit), but wether I try it out of AvsPmod or straight out of the windows explorer (Windows 10 x64), MPC-HC crashes. I think, is has something to do with recent updates of windows or some visual c++ libraries - just a feeling. So, my questions are: Could you compile a x64-version of your colormatrix-version, so I can try, if that works (there's no need for BT.2020 for me, btw.)? Colormatrix is working absolutely fine with AVS+ (x64) (multi- and single threaded), as explained here (http://forum.doom9.net/showthread.php?p=1865335).

I use colormatrix quite a lot for documentations, series and movies without visual features (comedies, intimate theater ...), which I re-encode to SD anamorph (mostly 16:11).
Here:
http://www.mediafire.com/file/aj88vdobroxjbkd/ColorMatrix26.7z/file

Groucho2004
1st May 2020, 19:41
So, my questions are: Could you compile a x64-version of your colormatrix-version, so I can try, if that works (there's no need for BT.2020 for me, btw.)?Have you tried the one from this page (https://forum.doom9.org/showthread.php?t=173259)?

almosely
1st May 2020, 19:51
Ola! Thank you both very much :-) The version linked by kedautinh12 is directing to your download page, Groucho. Just tested it with an .avs-script, dragged into mpc-hc via windows explorer - worked fine :-)

- edit -

Hah, now I remember: The last time I checked your thread, Groucho, the link to the download-site was not working; but that was quite a while ago.

Groucho2004
1st May 2020, 20:31
The version linked by kedautinh12 is directing to your download page, Groucho.I didn't realize. Anyway, I'm glad it works for you.

hello_hello
2nd May 2020, 05:36
Don't forget ColorMatrix v2.6 has issues.

Even though it seems it was never intended to convert between rec.2020 and rec.601, it allows you to specify a conversion in either direction, but rather than produce an error message, it's does nothing.

Conversions from rec.709 to rec.2020 seem okay, but conversions from rec.2020 to rec.709 produce a different result to other programs such as DitherTools.

ColorMatrix doesn't convert the color primaries as programs such as HDRTools (can) do (neither does DitherTools). I still don't understand the logic behind converting to/from rec.2020 using a matrix-only method.

I've only played with the 32 bit version.

tormento
18th October 2024, 11:09
Would be possible to extend the allowed input formats to HBD/YV24 and so?

takla
18th October 2024, 13:57
Would be possible to extend the allowed input formats to HBD/YV24 and so?

Use Avsresize (http://avisynth.nl/index.php/Avsresize#Changing_Colorimetry) instead.

tormento
18th October 2024, 14:35
Use Avsresize instead.
I know it but the syntax is so comfortable with ColorMatrix :p

FranceBB
18th October 2024, 22:53
+1 for high bit depth support.
Colormatrix is pretty old nowadays but it would be nice seeing it come back to life.

kedautinh12
19th October 2024, 07:42
+1 for high bit depth support.
Colormatrix is pretty old nowadays but it would be nice seeing it come back to life.

You can ask and share source code to Asd-g, i think he will do it

tormento
19th October 2024, 15:58
You can ask and share source code to Asd-g, i think he will do it
I always hope that he is lurking in this forum.

hello_hello
20th October 2024, 07:10
tormento,
I ripped this out of my CropResize function and modified it a bit. It's about as close to the ColorMatrix syntax as you'll get while supporting "matrix only" conversions as well as "matrix and primary colors" conversions . Hopefully there's no bugs. It requires FMTConv.

ColorConv.avsi (https://files.videohelp.com/u/210984/ColorConv.avsi)

Edit: See post #22 (https://forum.doom9.org/showthread.php?p=2008591#post2008591) for a version using AVSResize.

For 32 bit video the conversion happens in 32 bit float. For all other video the color conversion happens in 16 bit.
There's a list of conversions at the top of the script (supports conversions between rec.601, rec.709 & rec.2020).

Examples:

ColorConv("601-709M") Matrix only conversion from rec.601 to rec.709
ColorConv("709-2020M") Matrix only conversion from rec.709 to rec.2020
ColorConv("709-2020") Matrix & primaries conversion from rec.709 to rec.2020
ColorConv("601P-709") Matrix & primaries conversion from rec.601 (PAL primaries) to rec.709
ColorConv("601N-2020") Matrix & primaries conversion from rec.601 (NTSC primaries) to rec.2020

hello_hello
20th October 2024, 08:04
I've re-uploaded the ColorConv function I linked to in my previous post to add a couple of missing conversions. Sorry about that.

hello_hello
20th October 2024, 10:49
I created a version of the function that uses AVSResize. Other than that it works the same way as the FMTConv version.

ColorAVS.avsi (https://files.videohelp.com/u/210984/ColorAVS.avsi) (AVSResize version)
ColorConv.avsi (https://files.videohelp.com/u/210984/ColorConv.avsi) (FMTConv version)

For 32 bit video the conversion happens in 32 bit float. For all other video the color conversion happens in 16 bit.
There's a list of conversions at the top of the script (supports conversions between rec.601, rec.709 & rec.2020).

Examples:

ColorAVS("601-709M") Matrix only conversion from rec.601 to rec.709
ColorAVS("709-2020M") Matrix only conversion from rec.709 to rec.2020
ColorAVS("709-2020") Matrix & primaries conversion from rec.709 to rec.2020
ColorAVS("601P-709") Matrix & primaries conversion from rec.601 (PAL primaries) to rec.709
ColorAVS("601N-2020") Matrix & primaries conversion from rec.601 (NTSC primaries) to rec.2020

---------------------------------------------

ColorConv("601-709M") Matrix only conversion from rec.601 to rec.709
ColorConv("709-2020M") Matrix only conversion from rec.709 to rec.2020
ColorConv("709-2020") Matrix & primaries conversion from rec.709 to rec.2020
ColorConv("601P-709") Matrix & primaries conversion from rec.601 (PAL primaries) to rec.709
ColorConv("601N-2020") Matrix & primaries conversion from rec.601 (NTSC primaries) to rec.2020

tormento
20th October 2024, 17:28
I ripped this out of my CropResize function
Great, I will test it ASAP.