View Full Version : Photoshop Unsharp Mask for Avisynth
CQCmaster
18th August 2008, 22:04
Is there a port of Adobe Photoshop Unsharp Mask filter to Avisynth?
If not, then which sharpening filters are good out there: something strong and effective?
mozzle
18th August 2008, 22:31
Didee's LimitedSharpenFaster AVS script:
http://avisynth.org/mediawiki/LimitedSharpen
There are four different modes. 'Smode=1' is listed as the "UnsharpMask" choice. You can modify strength for all modes ('strength=xxx').
pitch.fr
19th August 2008, 00:29
LSF is most effective but not strong....that's the whole point.
use VDUB's unsharp masking from neuron2 :
VD_UnsharpMask(diameter=3,strength=__,threshold=0)
I like to mix them both actually :D
talen9
19th August 2008, 00:35
The OP is asking for an AviSynth unsharp filter, not a VDub one :)
Look here (http://avisynth.org/mediawiki/External_filters#Sharpeners) for a list of sharpeners, there are at least two of them based on the unsharp principle/algorithm: Tunsharp and Unsharpmask, follow the links or search for them in this very same forum :)
pitch.fr
19th August 2008, 01:06
well it works in AVS of course, thanks to vdub_filters.avs
I've tried them all, this one looks the nicest IMHO for unsharp masking in AVS.
Blue_MiSfit
19th August 2008, 01:42
SeeSaw is a great sharpener for clean sources. I've never like LimitedSharpenFaster...
~MiSfit
pitch.fr
19th August 2008, 01:45
is it me or SeeSaw always denoises ?
CQCmaster
19th August 2008, 05:42
SeeSaw is a great sharpener for clean sources. I've never like LimitedSharpenFaster...
~MiSfit
I just tried SeeSaw and man it is slow. I like the fact that you can use your own denoisers but it is very slow. I even tried using the multi thread tool but for that I get a strange anomaly.
I am more curious about the unsharpmask... strangely I can't seem to find the .dll anywhere on this forum.
Btw, I am a MeGui user and not Vdub.
mikeytown2
19th August 2008, 08:14
unsharpmask is part of the warpsharp package (http://avisynth.org/warpenterprises/files/warpsharppackage_25_dll_20031103.zip).
I'll go edit the wiki to reflect this... btw which version of warpsharp should be there, the 2003 or the 2008 one?
http://niiyan.net/?WarpSharpPackage
Didée
19th August 2008, 10:04
I just tried SeeSaw and man it is slow. I like the fact that you can use your own denoisers but it is very slow.
Given that quite some people seem to use SeeSaw for realtime playback, your comment seems a bit strange. Are you processing HD 1920x1080? (On such resolutions, everything is slow, except for the most primitive basic filters ...)
LSF is most effective but not strong....that's the whole point.
The whole point (and 'most effective', too) is to know what you're talking about. Try:
LimitedSharpenFaster( Smode = [1 or 3], ss_x=1.0, ss_y=1.0, strength=255, overshoot=255)
and tell again that it is "not strong" ... ;)
LSF is as strong as you want it to have, just choose suited settings for "Smode","strength", "overshoot" and "Lmode".
It's the limiting part of LSF that can make it appear as being not so strong ... but the limiting part is the main point of LSF. Creating Halos is trivially easy, but usually you don't really want that...
To get a bit of best of both worlds, there's "Lmode=3" in LSF: overshoot=zero on edges (->no halos), but overshoot=[overshoot] on not-edges (-> pixel contrast enhancement on texture/detail).
For those having issues with sharpening-with-lots-of-parameters - functions, I'd recommend
sharpen(1)
It's easy to use, and it achieves a strong effect. :)
CQCmaster
19th August 2008, 10:15
I was actually playing with HD 1280x720... The filter goes in realtime when I use the multi threaded tool without degrain or any other denoiser. But when I add a denoiser, with MTi, the height of the displays becomes twice as big with no playback.
Nevertheless, I will try LimitedSharpen as it shows a lot of potential.
pitch.fr
19th August 2008, 10:16
well yeah, I love LSF coz it doesn't make halos all over the place and it sharpens the motion blur....that's its major feature :eek:
you get a sharper picture w/o too many drawbacks(posterizing if strength is set too high in Smode 3)
when set very low, neuron's unsharp masking is a nice addition to LSF IMHO(besides it's already built in ffdshow) ;)
CQCmaster
19th August 2008, 10:17
unsharpmask is part of the warpsharp package (http://avisynth.org/warpenterprises/files/warpsharppackage_25_dll_20031103.zip).
I'll go edit the wiki to reflect this... btw which version of warpsharp should be there, the 2003 or the 2008 one?
http://niiyan.net/?WarpSharpPackage
Thanks a lot for the info.
CQCmaster
19th August 2008, 10:49
So i just tried to load LimitedSharpenFaster and got this error below. I checked the line 102 in LimitedSharpenFaster.avsi and it seems that everything is fine.. I am using RemoveGrainSSE2
RemoveGrain: invalid mode 19
(, line 102)
(noname.avs, line 11)
Didée
19th August 2008, 11:00
http://avisynth.org/mediawiki/Removegrain
You need to get the "v1.0b "beta" release", and don't use the ~SSE3 versions.
(The official v0.9 is too old, the intermediate pre-v1.0 exist in different versions with different bugs, and the actual v1.0 changed the internal framework by so much that it's quite incompatible with the old versions for which most scripts are layed out...)
pitch.fr
19th August 2008, 11:02
the SSE3 is fixed in the latest rls from what its author says.
besides if I don't use it on my Q6600, I don't get the frame rate info in Reclock.
RemoveGrain-1.0.rar SSE3 works fine with the spline36 version of LSF here :)
CQCmaster
19th August 2008, 11:15
http://avisynth.org/mediawiki/Removegrain
You need to get the "v1.0b "beta" release", and don't use the ~SSE3 versions.
(The official v0.9 is too old, the intermediate pre-v1.0 exist in different versions with different bugs, and the actual v1.0 changed the internal framework by so much that it's quite incompatible with the old versions for which most scripts are layed out...)
That did the trick. Thanks!
Seems to be very effective and strong, too. I wonder which denoiser would work good with LSF...
Didée
19th August 2008, 11:17
the SSE3 is fixed in the latest rls from what its author says.
besides if I don't use it on my Q6600, I don't get the frame rate info in Reclock.
RemoveGrain-1.0.rar SSE3 works fine with the spline36 version of LSF here :)
Yeah, but it breaks compatibility with most (if not all) scripts that make use of the temporal filters (clense, temporalrepair). For these you need the new package RemoveGrainT. But then, it still breaks those scripts, because the framework of those filters was changed majorly.
That's the reason why I don't blindly recommend the actual RemoveGrain v1.0 package. If you tell "that's the version to use", then lots of older scripts will not work anymore.
BTW, aching for the SSE3-versions is childish ... RemoveGrain internally runs with a speed of several hundreds FPS (on SD). Even if a proper SSE3 version should run a tiny bit faster - IT DOESN'T MATTER.
pitch.fr
19th August 2008, 11:32
hehe, you always sound so peremptory Didee :)
but well, LSF is so awesome...I will forgive you :D
I use LSF on HD content to sharpen up the motion blur in 24fps, and if I don't use the SSE3 version Reclock says "no video stream found".....besides I only care for LSF/Ulevels/DDCC in realtime in ffdshow ;)
BTW I've replaced all the bicubicresize in LSF with spline36resize, hope that's OK ? http://forum-images.hardware.fr/icones/smilies/jap.gif
Didée
19th August 2008, 12:00
you always sound so peremptory
Just to hide from the fact I'm clueless. :)
Replacing Lanczos with Spline36 is perfectly okay, probably even preferred. (Though the unknown "step-back-by-one" fix for Smode=3 would be more urgent than the lanczos->spline thingy...)
I remember you told in another thread about RemoveGrain-related problems with Reclock. I never used Reclock, so can't tell anything about that. Perhaps the problem is in Reclock itself, perhaps the problem is in ffdshow (Avisynth-in-ffdshow can be tricky). All I can tell is that with "normal" frameserving (i.e. not ffdshow's Avisynth tab) such a problem doesn't occur ... so I don't care.
Nikos
19th August 2008, 12:05
According to this http://videoprocessing.11.forumer.com/viewtopic.php?t=97 (Thu Jan 24, 2008 ) post, there is not any problem with the latest Spatial Removegrain 1.0 and LSF. The same for LimitedRemoveDust and Clense/TemporalRepair.
By the way, is there any info for Temporal RemoveGrain?
Didée
19th August 2008, 12:17
According to this http://videoprocessing.11.forumer.com/viewtopic.php?t=97 (Thu Jan 24, 2008 ) post, there is not any problem with the latest Spatial Removegrain 1.0 and LSF. The same for LimitedRemoveDust and Clense/TemporalRepair.
By the way, is there any info for Temporal RemoveGrain?
LoadPlugin("D:\RemoveGrainSSE2.dll")
LoadPlugin("D:\RemoveGrainTSSE2.dll")
blankclip( pixel_type = "YV12" )
clense( reduceflicker = false )
==> " clense does not have a named argument 'reduceflicker' "
Per default, clense always uses *not* the original previous frame, but the already clense'd previous frame (recursive operation). This kind of operation is
a) not a "true" temporal median
b) perfectly un-suited for e.g. MVTools-scripts, Interleave/SelectEvery solutions, etc.
With all the older RemoveGrain versions, the recursive operation could be simply switched off with "reduceflicker=false".
In the actual v1.0, this parameter does not exist anymore. Instead, you're faced with "previous/next" clip parameters (easy), with "recursion slots" (harder), and whatnotelse.
Updating scripts from older RemoveGrain versions to the actual one is not at all trivial. It's a funstopper, especially since those older scripts do not benefit in any way from the upgrade. It's just that you have to jump through loops, only to get the old functionality back.
What would happen in practice is this: people would no more complain that a script doesn't work because of "unknown mode 19" (or "20").
Instead, they would complain that a script doesn't work because of "[put random other error message here]".
pitch.fr
19th August 2008, 12:18
Replacing Lanczos with Spline36 is perfectly okay, probably even preferred. (Though the unknown "step-back-by-one" fix for Smode=3 would be more urgent than the lanczos->spline thingy...)
don't tell me LSF could be improved even further in Smode=3 ? :eek:
I dunno what the step-back-by-one fix is...
also "special" doesn't quite work, but you know that.
after playing around with LSF for a long time, I've found out that I prefer to have neuron's unsharp masking doing some very slight EE(to increase the 3D depth), instead of using Lmode=2/3+overshoot.
it's an awesome combination......together with some spline resize to native res, no upscaling chip can reach the end result :eek:
here's some thumbnails(click to get 720p original screenshots from HR) :
http://pix.nofrag.com/7/b/4/ba67a6e00fe1d143238978fa776c4tt.jpg (http://pix.nofrag.com/7/b/4/ba67a6e00fe1d143238978fa776c4.html)
http://pix.nofrag.com/7/b/9/106cf2f94eaec28a0da84a6ddc5e0tt.jpg (http://pix.nofrag.com/7/b/9/106cf2f94eaec28a0da84a6ddc5e0.html)
Nikos
19th August 2008, 13:55
Thanks Didée for the explanation, in general i don't using clense. I am interesting for Temporal RemoveGrain but there is not any info for new modes except the source code.
CQCmaster
19th August 2008, 22:58
don't tell me LSF could be improved even further in Smode=3 ? :eek:
I dunno what the step-back-by-one fix is...
also "special" doesn't quite work, but you know that.
after playing around with LSF for a long time, I've found out that I prefer to have neuron's unsharp masking doing some very slight EE(to increase the 3D depth), instead of using Lmode=2/3+overshoot.
it's an awesome combination......together with some spline resize to native res, no upscaling chip can reach the end result :eek:
here's some thumbnails(click to get 720p original screenshots from HR) :
http://pix.nofrag.com/7/b/4/ba67a6e00fe1d143238978fa776c4tt.jpg (http://pix.nofrag.com/7/b/4/ba67a6e00fe1d143238978fa776c4.html)
http://pix.nofrag.com/7/b/9/106cf2f94eaec28a0da84a6ddc5e0tt.jpg (http://pix.nofrag.com/7/b/9/106cf2f94eaec28a0da84a6ddc5e0.html)
wow man, that looks pretty damn sharp.. care to share the avs settings? also, any ghosting?
fantasyl
30th September 2008, 15:56
wow man, that looks pretty damn sharp.. care to share the avs settings? also, any ghosting?
+1 :script:
Does it work with 720p in realtime?
pitch.fr
30th September 2008, 16:14
+1 :script:
Does it work with 720p in realtime?
if your CPU is fast enough, yes :D
at this point, I'm using this script on everything with my o/c Q6600 :
MT("""
LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40)
ULevels(preset="tv2pc")
GrainFactory(3,5,100,100)
""",4)
ConvertToRGB32(matrix="PC.709")
plus some gamut conversion through a PS script via the AviShader() plugin, to watch movies in their native SMPTE-C gamut(for US BD/DVD, and EBU for european)
all credits go to Didee, LaTo, IanB, Manao, trbarry and some others I forget :D
fantasyl
30th September 2008, 18:33
mhhh....doubt it, my e2180@2.66ghz is doing denoise, motionflow script and unsharp mask with 720p at 50/60%, but it's struggling for 1080p (downscaled to 720, of course!) at 80-95%.
Will try your script and msharpen.....
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.