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

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th June 2018, 16:44   #1  |  Link
K.i.N.G
Registered User
 
Join Date: Aug 2009
Posts: 90
How to do 3D Lut color correction (.3DL .Cube) with avisynth(+) ?

I wasn't too happy with the current HDR -> SDR filters available so I decided to create some luts but I can't find anything online on how to use them in avisynth?

Surely this must be possible? Since luts are such commonly used files for this kind of thing.
K.i.N.G is offline   Reply With Quote
Old 25th June 2018, 17:58   #2  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by K.i.N.G View Post
I wasn't too happy with the current HDR -> SDR filters available
Which ones did you try and why were you unhappy with them?
videoh is offline   Reply With Quote
Old 26th June 2018, 14:08   #3  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
There is a VapourSynth filter that can apply 3D LUT's in .cube format (some Adobe thing I believe), FWIW.
TheFluff is offline   Reply With Quote
Old 29th June 2018, 12:48   #4  |  Link
K.i.N.G
Registered User
 
Join Date: Aug 2009
Posts: 90
Quote:
Originally Posted by videoh View Post
Which ones did you try and why were you unhappy with them?
DGHable and DGReinhard ... i get the impression some tones are problematic.
With my current test im having problems with orange reds (getting too orange yellow). Making skin tones not as good as i'd like.
Maybe its just me? I've only tested 2 discs for now.

Also, I'm not a big fan of exaggerated tinting of a whole movie (there are exceptions) or remasters ruined by bad grading.
Good examples are "the good, the bad and the ugly remastered" or the lord of the rings trilogy extended edition... where the grading looks much worse than the original.

So also in those cases it would be sweet if I could just use/load a lut with corrections I did (to my personal taste).
K.i.N.G is offline   Reply With Quote
Old 29th June 2018, 12:54   #5  |  Link
K.i.N.G
Registered User
 
Join Date: Aug 2009
Posts: 90
Quote:
Originally Posted by TheFluff View Post
There is a VapourSynth filter that can apply 3D LUT's in .cube format (some Adobe thing I believe), FWIW.
Nice, I'll have to try that out later...
Im using DGhable & DGreinhard in avisynth (through StaxRip) though so I'd be more usefull for me if there was a solution using avisynth
K.i.N.G is offline   Reply With Quote
Old 9th August 2018, 20:51   #6  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
I came across this topic looking for a LUT plugin in Avisynth/Avisynth+.
I'm actually using ffmpeg to apply my LUTs, but it would be really useful to have the VapourSynth filter ported to Avisynth.
FranceBB is online now   Reply With Quote
Old 10th August 2018, 06:58   #7  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
I once asked here if somehow possible to port this into avisynth http://forum.doom9.org/showthread.ph...29#post1837229

Seems like it's something that will be difficult... it's really something i miss to make avisynth complete for my use, like you i use ffmpeg to do this task for now when i need it.
Yanak is offline   Reply With Quote
Old 11th August 2018, 00:50   #8  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
I doubt it would be hard to port, the plugin interface is separated from the actual processing.
TheFluff is offline   Reply With Quote
Old 11th August 2018, 00:51   #9  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I've started working on it.
videoh is offline   Reply With Quote
Old 11th August 2018, 07:24   #10  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
You cannot imagine how sweet those words sound to my hears

If you manage to get this working on avisynth it will be a game changer for me and i imagine many others.

Thank you very much.
Yanak is offline   Reply With Quote
Old 11th August 2018, 14:52   #11  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
What formats do you need, in order of priority?
videoh is offline   Reply With Quote
Old 11th August 2018, 16:05   #12  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
For me I use mostly .cube files, not sure what others use the most, .3dl it's very rare to use those for me, i use more haldclut files than .3dl to say

Thank you.
Yanak is offline   Reply With Quote
Old 11th August 2018, 16:17   #13  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I was referring to the input and output pixel formats of the filter itself. Can you specify those please?

Assuming the filter exists, what would your script look like?
videoh is offline   Reply With Quote
Old 11th August 2018, 16:51   #14  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Definitely .cube as cube LUT format.
As to the color space and bit-depth, I would say 4:2:0 8bit / 4:2:0 10bit input and output.
LUTs are generally used to apply a specific type of color correction in post-production, but in a 2018-Avisynth scenario, I would say that they would be mainly use them for HDR.
In other words, I think people would use them to tone-map HDR to SDR, HLG to HDR10 and so on.
So I would say that Rec.709 and Rec.2020 should be supported as well.

Is it possible?

If you wanna test out two .cubes, you can find mine here:

Quote:
Originally Posted by FranceBB View Post

FranceBB is online now   Reply With Quote
Old 11th August 2018, 18:08   #15  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
^ What he said 420p8 mostly as input, I guess some use it on 422 too, and mostly 420p8/10 as output i think.

Also used on raw footage ( slog from drones for example) to correct colors, or to apply some effects like with CineStyle_S_Curve lut, or Kodachrome effect, can be used to turn stuff recorded in summer with loads or greens into autumn colors etc etc
Yanak is offline   Reply With Quote
Old 11th August 2018, 18:15   #16  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
OK, guys, thank you.
videoh is offline   Reply With Quote
Old 11th August 2018, 19:02   #17  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by Yanak View Post
i use more haldclut files than .3dl to say
Easy to convert HaldCLUT to CUBE with IWLTBAP_LUT_Generator. Did that with Pat David's G'MIC Film Emulations:

https://gmic.eu/film_emulation/negat...1.shtml#browse

Would be nice to use those in AVISynth(+).
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 11th August 2018 at 19:05.
WorBry is offline   Reply With Quote
Old 12th August 2018, 06:51   #18  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
Thanks for the link, i'll give it a try soon, G'mic plugin for Gimp is what i often use to create and generate custom haldcluts from static images i modify, then later apply them on videos via FFmpeg, this will certainly help a lot if videoh manage to get this working on avs+ it will be very nice indeed.

Thank you
Yanak is offline   Reply With Quote
Old 13th August 2018, 15:13   #19  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
You're welcome.

Quote:
Originally Posted by Yanak View Post
...videoh manage to get this working on avs+ it will be very nice indeed
Yes, it would open up many possibilities.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 13th August 2018, 16:27   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I have no idea if these couple of files are of any interest to anyone (had them for years, never really looked at them much).

Adobe Cube Lut Specs, v1.0(~228KB):- http://www.mediafire.com/file/ptd2lt....0.pdf.7z/file

yCMS_x86, excerpt from manual, (maybe there is an x64 version somewhere)
Quote:
yCMS - Color Management System
v1.12 2012/11/07

________________________________________________________________________________

INTRODUCTION
________________________________________________________________________________


yCMS is a Color Management System (CMS) that uses 3-dimensional lookup
tables ("3D LUTs") to perform the conversion between the input and output
color representations. You can read a little more about CMS here:
http://en.wikipedia.org/wiki/Color_management

The idea of using 3D LUTs was due to the intensive computing that needs to
be performed when converting video data between different color spaces. When
using 3D LUTs all computing is performed offline during its creation. The
computed 3D LUTs (three, one for each component) are then written to a file
which can later be used, when playing videos or viewing photos, simply by
mapping the input data through the 3D LUTs. This way, the conversion can be
performed at runtime using lower computational power and leaving more CPU
available for other tasks. Since all the computing is performed offline its
precision can be increased by using 64bit floating point (per component)
through out all the conversion chain.
(~239KB):- http://www.mediafire.com/file/8ppce1...S_x86.rar/file
EDIT: Above yCMS_x86 (home site is now dead) and thread here on D9 not active since 2013.
https://forum.doom9.org/showthread.p...highlight=ycms


EDIT:
Apply two 3x3 matrices to each pixel? :- https://forum.doom9.org/showthread.php?p=1706626

RGB/XYZ Matrices:- http://www.brucelindbloom.com/index....YZ_Matrix.html
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 14th August 2018 at 01:30.
StainlessS is offline   Reply With Quote
Reply

Tags
3dl, cube, hdr, lut, sdr

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 22:43.


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