Hysteria(), new line darkening script function for AVS

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

Hysteria(), new line darkening script function for AVS

Postby 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
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

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

Postby 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
Cannonaire
 
Joined: 05 May 2010
Location: Oregon
Status: OVERLOAD

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

Postby 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
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

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

Postby 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
Cannonaire
 
Joined: 05 May 2010
Location: Oregon
Status: OVERLOAD

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

Postby Zarxrax » Sun Sep 12, 2010 10:33 am

comparison pics please
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

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

Postby 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
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

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

Postby 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
Corran
 
Joined: 14 Oct 2002

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

Postby 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
post-it
 
Joined: 17 Jul 2002
Status: Audio: bass remains; if else, 3D

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

Postby 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.
Another Anime Convention AMV Contest Coordinator 2008-2014 & Head of the AAC Fan-works Theater - follow us on Twitter: https://twitter.com/#!/AACFanTheater
:sorcerer: :sorcerer: |RD: "Oh, Action!" (side-by-side) | |
User avatar
BasharOfTheAges
Just zis guy, you know?
 
Joined: 14 Sep 2004
Location: Merrimack, NH
Status: Extreeeeeeeeeme

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

Postby 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
User avatar
EvaFan
 
Joined: 21 Mar 2004
Location: Somerset, KY
Status: (*゚▽゚)o旦~ ー乾杯ー♪

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

Postby Mister Hatt » Mon Sep 13, 2010 12:00 pm

Aside from the occasional oversharpening, what's with the minor change in colour representation, especially on the green shirt in the second shot? Looks like quite an elegant script though.
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

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

Postby Scintilla » Mon Sep 13, 2010 5:35 pm

You sure that's not just an optical illusion? The only difference was whether or not the one line was commented out, and you can see that the function doesn't touch the chroma. And there's no way that the shirt was included in the mask.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

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

Postby mirkosp » Mon Sep 13, 2010 5:37 pm

Scintilla wrote:You sure that's not just an optical illusion? The only difference was whether or not the one line was commented out, and you can see that the function doesn't touch the chroma. And there's no way that the shirt was included in the mask.

I talked with him earlier on and in the end it's probably about how the colourspace conversion was handled when you made the PNGs, and not something about the filter... it's just that we didn't think of posting it in here afterwards. :asd:
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

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

Postby Mister Hatt » Mon Sep 13, 2010 9:52 pm

:LAZYMODO:
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

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

Postby Phantasmagoriat » Tue Oct 05, 2010 3:21 am

This is pretty neat. With fastlinedarken() I would sometimes get an uneven distribution of darkening where weaker lines would be untouched. This seems to make those weaker lines pop out too. Generally I like dark lines, but it really depends on how "cartoony" the anime is. Thanks, I'll be experimenting with this. :)
Image
Org Profile | AMVGuide | Phan Picks! | THE424SHOW | YouTube | "Galactic Escape"

"Effort to Understand; Effort to be Understood; to See through Different Eyes."
User avatar
Phantasmagoriat
 
Joined: 06 Feb 2006
Status: ☁SteamPunked≈☂


Return to Footage Help

Who is online

Users browsing this forum: No registered users and 2 guests