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. |
7th June 2010, 14:16 | #21 | Link | |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
If it's not fixed, can you try with Smode=0...4 ? Last edited by LaTo; 8th June 2010 at 16:50. |
|
14th June 2010, 16:02 | #22 | Link | |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Update 2010.06.14
v1.16:
replaced Smode 3 & 4 with stronger smoothing function changed minors things About Smode: Quote:
Last edited by LaTo; 14th June 2010 at 16:21. |
|
19th June 2010, 13:55 | #23 | Link |
Carlos Martinez
Join Date: Aug 2005
Posts: 288
|
This filter might be handy to what I am trying to do now, which is lowering the gamma on a video I have. What I want is getting some more detail in the shadows and darker areas.
What I am not familiar with is about the synthax to combine several functions together, and perhaps set some limiting on the brighter areas. I have already tried <SmoothLevels(gamma=1.5)> and it brings out a lot. But I wonder if combining others might get more and not make things too "milky". Limiting brighter areas would be handy too, I think. How do I write all this so I can play with the filters in AvsP? This is my more critical situation, where the musician on the right is too dark: http://www.mediafire.com/file/n4w5zu...contrast#1.jpg |
19th June 2010, 15:50 | #24 | Link | |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
Code:
SmoothLevels(gamma=1.6,Ecenter=32,Lmode=1) |
|
21st June 2010, 21:32 | #27 | Link |
Derek Prestegard IRL
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
|
Nice! Your scripts are AWEOSME, LaTo! I use SmoothLevels quite frequently so any update or additional functionality is enthusiastically welcomed!
Derek
__________________
These are all my personal statements, not those of my employer :) |
27th June 2010, 04:17 | #28 | Link |
Architect
Join Date: May 2010
Posts: 57
|
I have a video that seems to have been converted from tv->pc levels, which causes details to appear hidden in dark areas and washed-out or clipped in bright areas (think dynamic contrast).
The levels histogram is shown below: Using SmoothLevels(preset="pc2tv") gives the histogram below: That's probably how it was intended to look, but when viewed on a PC monitor it is clearly lacking contrast and vibrancy. I want to keep the contrast but still see details in bright and dark areas. I tried SmoothLevels(gamma=1.05, output_low=10, Lmode=3).SmoothTweak(contrast=0.92) giving the histogram below: The resulting image looks good enough but I really want to map tv 0 (i.e. 16) to pc 0 and tv white (i.e. 235) to pc 255, and a few levels above and below black and white could be mapped within 0-16 and 235-255 resp. How can I achieve that? BTW, it would be convenient to have a "show histogram" option in your plugin. |
27th June 2010, 10:06 | #29 | Link | |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
|
|
27th June 2010, 22:50 | #30 | Link |
Architect
Join Date: May 2010
Posts: 57
|
I want something like:
Code:
# Compress 0-255->10-237 SmoothLevels(gamma=1.05, output_low=10, output_high=237) # Stretch 10-16->0-16 SmoothLevels(input_low=10, input_high=16, output_low=0, output_high=16) # Stretch 235-237->235-255 SmoothLevels(input_low=235, input_high=237, output_low=235, output_high=255) |
27th June 2010, 23:48 | #31 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
That's S-curve contrast reduction, basically.
Too lazy to work out a general formula ... with fixed values to spread [0-8]>[0,16] and [247,255]>[239,255] : Code:
mt_lut("x 8 < x 2 * x 247 > 255 255 x - 2 * - x 8 - 247 24 - 247 8 - / * 16 + ? ?",U=2,V=2)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) Last edited by Didée; 28th June 2010 at 00:46. Reason: Fixed error pointed out by Gavino. Thankyou. |
28th June 2010, 00:45 | #33 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
No ... I was meaning
Code:
mt_lut("x 8 < x 2 * x 247 > 255 255 x - 2 * - x 8 - 247 8 - 8 - 8 - 247 8 - / * 16 + ? ?",U=2,V=2)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
28th June 2010, 01:12 | #34 | Link | |
Architect
Join Date: May 2010
Posts: 57
|
Quote:
I don't know RPN very well, or how mt_lut should be used, but I tried: Code:
mt_lut("x 8 < x 2 * x 252 > 255 255 x - 2 * - x 8 - 235 16 - 252 8 - / * 16 + ? ?",U=2,V=2) Original frame: Code above: Now I would like to make the dark levels a little brighter and then smooth the levels curve overall. Edit: Since this clip is probably supposed to look like tv levels [16,235], I should ask how to properly convert TV->PC such that the video doesn't look like dynamic contrast is turned on. Maybe something like 16-20 -> 0-16 and 233-235 -> 235-255. Last edited by Bi11; 28th June 2010 at 01:40. |
|
28th June 2010, 07:44 | #35 | Link | |||
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Quote:
Check e.g. here - do you see "everything"? Quote:
Quote:
When a clip IS TV levels, then it looks correct on TV-levels display devices, and looks washed-out on fullscale display devices. And vice versa, a PC-scale clip will look correct on fullscale devices, and overcontrasted on TVscale devices. Ah, I start getting lengthy .... anyway, what you are trying is solely a matter of personal preference. Not any kind of "correction" that would be "needed" to do. FWIW ... generalized LUT function with "dark point" + "factor", and "bright point" + "factor". Code:
point0 = 8 factor0 = 2.0 point1 = 247 factor1 = 2.0 P0=string(point0) P1=string(point1) F0=string(factor0) F1=string(factor1) mt_lut("x "+P0+" < x "+F0+" * x "+P1+" > 255 255 x - "+F1+" * - x "+P0+" - "+P1+" "+P0+" - 255 "+P1+" - "+F1+" * - "+P1+" "+P0+" - / * "+P0+" 2 * + ? ?") There really should be a levels-filter that works with control points and splines, like those brightness/levels/whatever controls that we all know from most existing image graphic editors. More than a decade of Avisynth, and nobody did that yet ...
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) Last edited by Didée; 28th June 2010 at 07:46. |
|||
28th June 2010, 08:42 | #36 | Link | ||
Architect
Join Date: May 2010
Posts: 57
|
Quote:
I knew the expr was wrong (I didn't know the correct one), but I still posted it so you would know what I was looking for (i.e. keeping white at 255). Quote:
I'll experiment with the generalized LUT function to see if I can get the results I want. |
||
28th June 2010, 09:40 | #37 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
I won't argue against that you see what you see. But it doesn't make sense to me. Given that the display doesn't clamp at close-to-white and close-to-black, you should be able to see all details in those areas without any adjustment. After all, these levels-manipulations don't invent any new information to start with. They only shift-around the already-present data.
It could be your playback filterchain. If you see all blacks and whites in the lagom tests, but don't see all blacks and whites during playback of a PC-scale video, then some part of your playback filterchain might do clamping to TV-levels.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
28th June 2010, 10:04 | #38 | Link | ||
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
That 2 on the end should clearly be F0, but the bit in the middle is wrong too. For the third case you have (x-p0)*[(p1-p0)-(255-p1)*f1]/(p1-p0) + p0*2 when it should be (x-p0)*[255-(255-p1)*f1-p0*f0]/(p1-p0) + p0*f0 It's easier to see if you write it like this: Code:
Y0 = P0+" "+F0+" *" Y1 = "255 255 "+P1+" - "+F1+" * -" mt_lut("x "+P0+" < x "+F0+" * x "+P1+" > 255 255 x - "+F1+" * - x "+P0+" - "+Y1+" "+Y0+" - "+P1+" "+P0+" - / * "+Y0+" + ? ?") Quote:
|
||
28th June 2010, 10:31 | #39 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Oh my, yes.
Seems it's not good to write LUTs with a bap in the left, cup'o'coffe in the right, and should've left for work five minutes ago.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
28th June 2010, 18:43 | #40 | Link | |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
It's on my todo list, someone has a good documentation/paper about splines? Last edited by LaTo; 28th June 2010 at 19:21. |
|
|
|