Hysteria(), new line darkening script function for AVS

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Hysteria(), new line darkening script function for AVS

Post by Scintilla » Sat Sep 11, 2010 9:24 pm

Sorry, you don't get an over-enthusiastic infomercial sales pitch this time.

You're probably looking at this and wondering if the world really needed another AVISynth filter for line darkening. Honestly, it's been less than a day since I started work on this one; it was an impulse code (think "impulse buy" but with programming), put together because I was getting frustrated by the other line darkeners I had to work with (FastLineDarken, vmToon/Toon, etc.).
But I'm pretty sure at this point that I accomplished what I'd set out to do, and it gave a decent result on my source, and hopefully some of you find it useful as well. Also, I'm open to suggestions for improvement.

So, what does this (admittedly whimsically-named) filter do that other line darkeners don't?
  • It uses something called a "hysteresy mask" (this is where the name comes from; unfortunately the Geocities page containing the explanation for this algorithm has been lost and is not available on archive.org) in an attempt to produce a mask that has all the edges you need to darken but none of the noise. Considering how long MaskTools has had this functionality, I'm a little surprised nobody thought of this sooner.
  • It actually allows you to tweak the mask itself, through the use of two thresholds, one for each mask that goes into the hysteresis. The lack of this kind of feature is probably my biggest gripe with the other filters.
  • It allows for an absolute cap on how much any one pixel can be darkened by, allowing you to increase the darkening on weaker lines without overdoing the stronger ones.
The file is up at: http://www.aquilinestudios.org/scripts/ ... 00911.avsi
You know the drill by now: save it to your AVISynth plugins directory (don't change the filename), then call like any other filter.

It's reasonably fast, containing as it does no supersampling, warpsharpening, or two-point sharpening. I'd be interested to see if anyone else finds this useful.
(In case anyone cares, the source that drove me to create this was Nodame Cantabile. It's a clean enough source, but the edges were just way too soft for my taste.)


disclaimer: this has absolutely nothing to do with a certain Steven Spielberg cartoon.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by Cannonaire » Sun Sep 12, 2010 6:50 am

It starts to render, but then crashes AVSP immediately (right after the preview window expands to show the frame).
It also crashes VirtualDub. No error given, it just dies and the windows 'close this program' error message comes up. :?

It runs if usemask=false, which I assume means don't use MVTools.

I'm using VDub 1.9.9, Avisynth 1.6 (beta?).

mvtools.dll is 1.8.5.1. I have no clue if it's outdated or not, but I should probably check that (I didn't want to change it in the middle of a project).
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by mirkosp » Sun Sep 12, 2010 6:56 am

There's vdub 1.9.10 now, and avisynth 1.6... wut? You likely meant 2.6, which is alpha regardless (latest stable avisynth still is 2.5.8, but 2.6 is fine to use despite being alpha). Also, Hysteria requires masktools, not mvtools (the latest of which is 1.11.4.5, afaik, and there is a v2 branch too, latest of which is 2.5.10.1). Masktools' latest is 2.0a45, released a few days ago (7th September), and there really is no issue with updating it midproject.
Image

User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by Cannonaire » Sun Sep 12, 2010 7:16 am

Cool. I'm actually rushing to get to work right now, but I'll try it when I get home. :oops: And yes, I do mean Avisynth 2.6a.

For some reason moving MVTools did change the error I got... so i guess this means I have something strange going on with that. /sigh, just more stuff to fix.

Back on topic, I can't wait to check this out. It sounds really useful. Thanks again, Scintilla!
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by Zarxrax » Sun Sep 12, 2010 10:33 am

comparison pics please

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by Scintilla » Sun Sep 12, 2010 1:15 pm

Dammit, I was kind of hoping nobody would ask for those. Now I actually have to expend some extra effort.

http://www.aquilinestudios.org/compare/hysteria.html will let you do the mouseover thing for instant comparison.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
Corran
Joined: Mon Oct 14, 2002 7:40 pm
Contact:
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by Corran » Sun Sep 12, 2010 1:38 pm

With the quality of animation and its transfer to distribution formats these days, I don't understand the need for such a filter, at least as used in the before/after comparison you posted. Older sources may be a different story. If the animation company really wanted lines that really contrast like that, they would have done so themselves.

A handful of videos that I like have used fastlinedarken and it kind of irks me. While most people might not notice or care it prevents me from fully enjoying the video. Was it really necessary? The original source was beautiful in this regard...

User avatar
post-it
Joined: Wed Jul 17, 2002 5:21 am
Status: Hunting Tanks
Location: Chilliwack - Fishing
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by post-it » Sun Sep 12, 2010 2:32 pm

. I can see what its doing and the results remind me of what Warp2Sharp was
supposed to do when it was introduced to Virtual Dub all those years ago:
"to sharped the Darker-Outlines and make the Lines-Look-Thinner. ( sorta like a FOCUS adjustment.)"

. It might be handy for up-scaling older Anime 8-)

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by BasharOfTheAges » Sun Sep 12, 2010 6:35 pm

It looks like it'd work in reducing the jarringness of mixing certain series with blurry lines with those that have sharper lines.
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
EvaFan
Joined: Sun Mar 21, 2004 10:25 pm
Status: (*゚▽゚)o旦~ ー乾杯ー♪
Location: Somerset, KY
Org Profile

Re: Hysteria(), new line darkening script function for AVS

Post by EvaFan » Mon Sep 13, 2010 4:38 am

If at some point you add a line thinning parameter then I might actually use this :P , it's nice for what it was made to do but I don't really like the way it makes lines look overly thick.
"The people cannot be [...] always, well informed. The part which is wrong will be discontented, in proportion to [...] the facts they misconceive. If they remain quiet under such misconceptions, it is lethargy, the forerunner of death to public liberty. What country can preserve its liberties, if it's rulers are not warned [...] that this people preserve the spirit of resistance? The tree of liberty must be refreshed from time to time, with the blood of patriots and tyrants."-Thomas Jefferson

Locked

Return to “AviSynth Help”