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. |
28th January 2009, 10:42 | #1 | Link |
Resize Abuser
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
|
Sharpener Testing Script
After watching this video here (Skip to about 19 Min in, the rest of it is kinda boring...)
http://meetthegimp.org/episode-085-geeks-only-really/ I decided to replicate this using the files provided via this link http://simplefilter.de/en/analysis/contrast.html http://simplefilter.de/download/SF_C...estkit_RGY.zip Run Script Below and have fun testing various AviSynth sharpeners! Code:
#Number of pixels In (1-5) pixels = 5 #Don't Change colors = 256 depth = pixels*2-1 #Gray Bars BlankClip(1,colors,colors*depth,"YV12",25, color=$000000) base = mt_lutspa(false, mt_polish("(x%2)?127-(x/2):128+(x/2)"), U=-128, V=-128).PointResize(width*depth, height) #Gradient gradient_mask = base.GraMaMa(4, 0, colors*depth, 0, colors*depth) #Blank Clip BlankClip(1,colors*depth,colors*depth,"YV12",25, color=$000000) blank=last #Red Channel mtString_red = (depth==3) ? mt_polish("(x%3==0)?255:(x%3==2)?255:0") : \ (depth==5) ? mt_polish("(x%5==0)?255:(x%5==2)?255:(x%5==4)?255:0") : \ (depth==7) ? mt_polish("(x%7==0)?255:(x%7==2)?255:(x%7==4)?255:(x%7==6)?255:0") : \ (depth==9) ? mt_polish("(x%9==0)?255:(x%9==2)?255:(x%9==4)?255:(x%9==6)?255:(x%9==8)?255:0") : \ mt_polish("0") red = mt_lutspa(false, mtString_red, U=-128, V=-128) #Green Channel mtString_green = (depth==3) ? mt_polish("(x%3==1)?255:0") : \ (depth==5) ? mt_polish("(x%5==1)?255:(x%5==2)?255:(x%5==3)?255:0") : \ (depth==7) ? mt_polish("(x%7==1)?255:(x%7==2)?255:(x%7==3)?255:(x%7==4)?255:(x%7==5)?255:0") : \ (depth==9) ? mt_polish("(x%9==1)?255:(x%9==2)?255:(x%9==3)?255:(x%9==5)?255:(x%9==6)?255:(x%9==7)?255:0") : \ mt_polish("0") green = mt_lutspa(false, mtString_green, U=-128, V=-128) #Blue Channel mtString_blue = (depth==7) ? mt_polish("(x%7==3)?255:0") : \ (depth==9) ? mt_polish("(x%9==3)?255:(x%9==4)?255:(x%9==5)?255:0") : \ mt_polish("0") blue = mt_lutspa(false, mtString_blue, U=-128, V=-128) #RGB Channel - Color Mask rgy_color_mask = MergeRGB(red, green, blue) base ########################## #Test Your Sharpener Here# ########################## LimitedSharpenFaster() ########################## #End of Sharpener Area # ########################## Overlay(last, gradient_mask, mode="difference", pc_range=true) Levels(129,128,0,0,255,false) (Depth==1) ? last : Overlay(rgy_color_mask, last, mode="multiply", pc_range=true) PointResize(width,512).Spline64Resize(512,512).Levels(0,4,255,0,255) mt_***() - http://avisynth.org/mediawiki/MaskTools2 Here's LSF Output (yes it's not all black - click on the thumbnail) EDIT: Use this to test about any function... DeHalo, Resize, Blur, ect... EDIT: Thanks J_Darnley for using masktools! EDIT: Using Better Colors -Cyan & Magenta Better resize for high pixel count - Easier to read, still gets the idea across.
__________________
Mine: KenBurnsEffect/ZoomBox CutFrames Helped: DissolveAGG ColorBalance LQ Animation Fixer Last edited by mikeytown2; 2nd February 2009 at 10:04. |
28th January 2009, 13:10 | #2 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
try lsf with:
limitedsharpenfaster(smode=4, ss_y=1, ss_x=1, overshoot=0, strength=80) That should more accurately reflect the performance of limitedsharpen's underlying principles. I would like to play around with this, but I have an old version of the GIMp which won't wok with that stuff, and I'm not willing to update it. |
28th January 2009, 13:44 | #3 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
I think you could generate them with some mt_lutspa and MergeRGB
rgycolourmask goes: red, green, yellow, green, red, repeat To generate testimage: Code:
mtString = mt_polish("(x%2)?127-(x/2):128+(x/2)") mt_lutspa(false, mtString, U=-128, V=-128) PointResize(width*5, height) To generate rgycolourmask: Code:
mtString_red = mt_polish("(x%5==0)?255:(x%5==2)?255:(x%5==4)?255:0") red = mt_lutspa(false, mtString_red, U=-128, V=-128) mtString_green = mt_polish("(x%5==1)?255:(x%5==2)?255:(x%5==3)?255:0") green = mt_lutspa(false, mtString_green, U=-128, V=-128) MergeRGB(red, green, blank) And here is your lsf suggestion: http://users.telenet.be/darnley/avisynth/test-lsf-1.png And so for completeness: Code:
BlankClip(1500,256,1280,"YV12",25, color=$000000) base = mt_lutspa(false, mt_polish("(x%2)?127-(x/2):128+(x/2)"), U=-128, V=-128).PointResize(width*5, height) gradient_mask = base.GraMaMa(4, 0, 1280, 0, 1280) BlankClip(1500,1280,1280,"YV12",25, color=$000000) mtString_red = mt_polish("(x%5==0)?255:(x%5==2)?255:(x%5==4)?255:0") red = mt_lutspa(false, mtString_red, U=-128, V=-128) mtString_green = mt_polish("(x%5==1)?255:(x%5==2)?255:(x%5==3)?255:0") green = mt_lutspa(false, mtString_green, U=-128, V=-128) rgy_color_mask = MergeRGB(red, green, last) base #Test Your Sharpener Here limitedsharpenfaster(smode=4, ss_y=1, ss_x=1, overshoot=0, strength=80) Overlay(last, gradient_mask, mode="difference", pc_range=true) Levels(129,128,0,0,255,false) Overlay(rgy_color_mask, last, mode="multiply", pc_range=true)
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. Last edited by J_Darnley; 28th January 2009 at 15:18. |
1st February 2009, 11:09 | #5 | Link |
Resize Abuser
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
|
@J_Darnley
Nice Work! Going to play around with MaskTools now... EDIT: Done playing check the first post. Sorta generalized it. Code:
level 5 - RGYCMCYGR level 4 - RGYCYGR level 3 - RGYGR level 2 - RGR level 1 - W
__________________
Mine: KenBurnsEffect/ZoomBox CutFrames Helped: DissolveAGG ColorBalance LQ Animation Fixer Last edited by mikeytown2; 2nd February 2009 at 10:04. |
2nd February 2009, 06:16 | #7 | Link |
Didée Fan
Join Date: Feb 2006
Location: Canada
Posts: 1,079
|
I caN get the patten and put a sharpener in there, but I can't be multiple colored lines in there and I don't know what those colored lines represent.
i tried to get it going to colored lines for close to a hour now and I'm tired and need to rest. |
2nd February 2009, 09:19 | #8 | Link |
Resize Abuser
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
|
2 Things that are important:
1. thats the easy part 2. level _n_ - The "radius/width" of the vertical lines is _n_px. M=Magenta R=Red G=Green Y=Yellow C=Cyan Code:
level 1 - M level 2 - RGR level 3 - RGYGR level 4 - RGYCYGR level 5 - RGYCMCYGR At Level 5: (9px wide) Red: first pixel on either side, right on the edge. -Edge Sharpness/Contrast Green: second pixel in from the edge. - Edge Sharpness/Halo Yellow: third pixel in from the edge. - Halo/Edge Sharpness Cyan: forth pixel in from the edge. - Halo Magenta: fifth pixel in from the edge. - Halo It lets you know how deep in from the edge the sharpener works. The more advanced/potentially stronger ones reach deeper into the stack. Example: if the Yellow line is more vertical then the Red line, then you get halos (means the center's contrast is increasing more then the edge). The more vertical the line is, it's more sharp. The more horizontal the line is, it's less sharp. 45 degree angle is untouched - "generally" what u want deeper in the stack: less halos in general. Watch the video (on the first post) in it's entirety if you still have questions... or play around by giving this script different inputs. Also disable the Levels() and/or the last Overlay() to play see this before mid stream. An Interesting Example is SeeSaw - It effects all levels. Code:
a=FFT3DFilter(10) SeeSaw(last,a)
__________________
Mine: KenBurnsEffect/ZoomBox CutFrames Helped: DissolveAGG ColorBalance LQ Animation Fixer Last edited by mikeytown2; 2nd February 2009 at 10:05. |
2nd February 2009, 10:01 | #9 | Link | |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,389
|
IMO it's mostly a waste of time. If you know your filter, then this method shows you what you already knew beforehand. If you don't know your filter, there's not much information to derive from the result.
Short of exhaustive elaboration, a few small examples: RemoveGrain(4), XSharpen(255,255), LimitedSharpen(ss_x/x=1.0,overshoot=0) all (should) give the same result: zero change. Same for SeeSaw: vanilla SeeSaw should give a zero result. In the above example with SeeSaw(+FFT3DFilter), you're actually measuring the effect of FFT3DFilter, not of SeeSaw. Whether there is overshoot or not has not much to say per se. Sharpness/contrast are partly correlated. Which kind of change is useful/wishful and which are not, that's a tricky decision to make. With a method as simple as this one (in regard to the test pattern), you won't get behind the lines. The way of generating the displayed result is nice by itself. Alas, the result is not interesting. Quote:
__________________
- 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!) |
|
2nd February 2009, 10:21 | #10 | Link |
Resize Abuser
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
|
@Didée
You are correct, it's mainly pointless. So I came up with a more interesting example showing the degradation of an image. I also updated the function... output is more user friendly in my opinion. Blur(1) Blur(1).Sharpen(1) Blur(1).Sharpen(1).Blur(1) Blur(1).Sharpen(1).Blur(1).Sharpen(1)
__________________
Mine: KenBurnsEffect/ZoomBox CutFrames Helped: DissolveAGG ColorBalance LQ Animation Fixer |
Thread Tools | Search this Thread |
Display Modes | |
|
|