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. |
|
|
Thread Tools | Search this Thread | Display Modes |
16th October 2011, 18:35 | #1 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
CineStyle(flat picture style) Lut corrected in Avisynth
Cinestyle LUT correction Avisynth script (using Gradation(vdub plugin) for making the amp curve and GiCoCU.dll to import it into Avisynth):
http://download.videohelp.com/tin2ti...ted_script.zip Unzip the inclosed files, add some video/image to the script and use it on photos/video shot with DSLR cameras using the CineStyle flat picture style. About CineStyle: http://blog.vincentlaforet.com/2011/...-canon-5dmkii/ The tutorial I followed: http://zech-fstop.blogspot.com/2011/...thout-lut.html
__________________
DVD slideshow GUI(Freeware). |
16th October 2011, 20:22 | #2 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Another solution, preserving dark shades better because of the 16-bit processing:
Code:
Function correct_cinestyle (clip c) { c Dither_convert_yuv_to_rgb (matrix="601", output="rgb48y") a = "0.05" x1 = "x 32768 - 32768 /" x2 = x1 + " 1.5 * " + x1 + " 3 ^ 0.5 * -" x3 = x2 + " 1 " + a + " + * " + x2 + " 3 ^ "+ a +" * -" Dither_lut16 (x3 + " 32768 * 32768 +", y=3, u=1, v=1) Dither_convert_rgb_to_yuv ( \ SelectEvery (3, 0), \ SelectEvery (3, 1), \ SelectEvery (3, 2), \ matrix="601", lsb=false, mode=6) }
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding Last edited by cretindesalpes; 16th October 2011 at 20:54. |
16th October 2011, 21:06 | #3 | Link | |
Registered User
Join Date: Mar 2005
Posts: 366
|
@ cretindesalpes
Very interesting solution! Completely out of my league. Will try it out. BTW. With your insights does this description of fixing moire make any sense to you? Quote:
http://colorbyjorg.wordpress.com/201...free-download/ Do you think it is possible to replicate that process in Avisynth?
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 16th October 2011 at 21:11. |
|
16th October 2011, 22:21 | #4 | Link | |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
Code:
RemoveGrain (0, 11, 11) RemoveGrain (0, 0, 11)
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
16th October 2011, 23:00 | #5 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Theres an image for testing that here:
http://www.komar.org/faq/camera/auto...cus-test-2.gif I don't see any differences with the removegrain you mentioned.
__________________
DVD slideshow GUI(Freeware). |
16th October 2011, 23:14 | #6 | Link | |
Registered User
Join Date: Mar 2005
Posts: 366
|
Played around with the settings(haven't read the docs yet). This seems to be an improvement on the moire, however there is a colorshift(left=original and right = RemoveGrain):
Quote:
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 16th October 2011 at 23:36. |
|
16th October 2011, 23:22 | #7 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Indeed, the author explicitly mentioned that it blurs only the chroma. So it won't make any difference on a black and white picture. The filter was designed for real-life scenes and artifacts generated by a specific camera.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
16th October 2011, 23:27 | #8 | Link | |
Registered User
Join Date: Mar 2005
Posts: 366
|
The settings I came up with does add blur. Gotta try with some Canon DSLR shots with micro-moire.
Another test image(photo): http://www.dcresource.com/reviews/ca...w/IMG_0312.JPG Quote:
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 16th October 2011 at 23:37. |
|
17th October 2011, 07:41 | #9 | Link | ||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
So always leave the first number to 0. Moreover, your call can be replaced by RemoveGrain(11)... |
||
19th October 2011, 14:11 | #10 | Link | |
Registered User
Join Date: Sep 2009
Posts: 378
|
Quote:
Using those photoshop .amp's and the GiCoCU.dll is all 8bit RGB and therefore not very desirable. |
|
4th June 2012, 14:31 | #12 | Link | |
Registered User
Join Date: May 2010
Location: France
Posts: 26
|
Quote:
I just used CretinDesAlpes function and it does wonder indeed but I have no clue about the syntax and reverse polish notation gives me headache... Could you elaborate a little bit more on it CretinDesAlpes, if you have time ? |
|
4th June 2012, 21:43 | #13 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
It computes the following formulas:
Code:
a = 0.05 x1 = (x - 32768) / 32768 ; x1 in -1...1 x2 = 1.5 * x1 - 0.5 * x1^3 ; 1st S curve x3 = (1 + a) * x2 - a * x2^3 ; 2nd S curve y = x3 * 32768 + 32768 ; Back to 0...65535 Second formula is the main S curve, keeping x2 in the same range as x1. Third formula is a second S curve, because the first curve was not enough. The formula is actually the same as the main one, but with a smaller curvature coefficient (0.05 instead of 0.5). Finally, the fourth formula converts the value back to the 16-bit scale. Given the CineStyle doc and the provided LUT, the curve works on RGB components, however it's not very clear if they are linear or gamma-compressed. I'd say it's most likely the latter. Working on the Y' signal would not give the expected results.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
4th June 2012, 23:50 | #14 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
The LUT is almost certainly applied to gamma compressed data in RGB, the NLE having first squeezed the full range luma levels off the Canon DSLR's into 16 - 235 and the RGB conversion based on that, which is the 'correct' approach in NLE land.
However I'm currently using 32 point '16bit' curve with SmoothCurve16 from SmoothAdjust plugin on the luma channel only, it gives results I'm happy with compared to applying curve to all channels in RGB but a mathmatical approach of correct_cinestyle even better. :-) Thanks for the correct_cinestyle function, that's neat, will now compare against SmoothAdjust luma only approach based on the RGB route above being correct, how far Y only approach is 'off' although its all subjective, Cinestyle is about capturing data efficiently in camera as best that it can be in 8bit not necessarily tgen applying this curve to give a more typical rec709 appearance. **EDIT** I see a lot of gaps in the luma waveform at regular intevals (vertical in case of histogram function) showing some scaling is going on. i don't see this when using SmoothCurve16 and the 32 point curve as the name suggests smoothing via interpolating values is going on to help reduce the gaps. Needed to add tv_range=false to both color space conversions in order to 'keep' full range luma that is in the original camera files but gaps are still there. :-( SmoothCurve16 Custom offers ability to mathmatically define a curve so is it possible to combine the two to reduce/remove gaps? **EDIT** Testing the 32 point SmoothCurve16 's' curve I have with a few cinestyle videos, by applying it to Y Cb & Cr channels and checking the output with ColorYUV(analyze=true) gives me identical results to cinestyle_correct but without the gaps in the luma channel so it would appear convertion to RGB and back is unnecessary. I'd kind of already concluded that as the Y only curve gave a better desaturated image for grading with but it is great to be able to test against the cinestyle_correct to confirm that. I'd assumed from comparing with ColorYUV, Cinestyle with same shot conditions just in other flat camera profiles, that the majority of difference between using Cinestyle (log) and a more typical 'flat' picture style (Linear) was really in the greyscale anyway. And if that's the case using SmoothTweak16 on the Cb&Cr before affecting the luma, which is how I'm currently doing it, so the combined effect can be seen in RGB preview ala AVSPmod, gives more color tweak control. Last edited by Yellow_; 5th June 2012 at 16:28. |
20th April 2013, 10:07 | #15 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
Just revisiting this thread and having problem with correct_cinestyle function, getting an error about mtlutxy unsupported color space Masktools only supports Planar YUV, Dither avs line 1022.
Simply feeding it a ffmpegsource decompressed h264 file, to my knowledge I have masktools v20a48 being used. |
20th April 2013, 10:12 | #16 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
Sorry, I'm sorted, I've been swapping machines about recently and the one I'm using had Avisynth 2.6 alpha not 2.5, even though I tried the -26 version of masktools but got the green screen, obviously something else was not right with the plugins loaded.
|
Thread Tools | Search this Thread |
Display Modes | |
|
|