FrostedGlow()

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.

FrostedGlow()

Postby Qyot27 » Wed Oct 06, 2010 10:14 pm

In reality, I've been playing around with an effect like this for a couple years now using Photoshop, but could never easily replicate it in AviSynth without creating a dependency hazard (the previous tactic used VariableBlur, which depends on fftw3). The process was much simplified when Phantasmagoriat posted BlurMod() yesterday.

That got me thinking about trying to get this done with AviSynth again, and after consulting with Phan about how to control BlurMod through another function and posting a similar topic on Doom9 about how to pass parameters from Overlay through transparently, the function took shape.

I'll take the time now to stress that this is more or less a purely frivolous video effect, not something you'd use to actually clean a source or enhance its lines the way Hysteria() or FastLineDarken() do.

Code: Select all
# FrostedGlow, version 2010-10-06
#
# Applies blur to the clip, then blends the blurred clip back onto the original.
#
# Range of the effect varies according to the blend mode used; the name of the function
# derives from the appearance when using Darken mode at low blur levels.
#
# Generally, colors get hazier while dark lines become more distinct, although the haze's brightness
# and the overall effect on color is dependent on the mode used.
#
# Requirements:
# BlurMod function by Phantasmagoriat
# gradfun2db
#
# Usage:
# FrostedGlow(clip c, float blurstrength, float opacity, string mode)
#
# All three of the function's parameters are the same as the options they correspond with in their source filters.
#
# 'blurstrength' acts the same as BlurMod(x), where 'x' is a float. 
# Recommended values for blurstrength are between 1 and 5, at least from my limited testing.
#
# 'mode' and 'opacity' control the way Overlay treats the video.
#
# 'mode' changes the method by which the blurred video is overlaid onto the source.
#
# 'opacity' changes the degree of transparency of the blurred video.
#
# There are no recommended values for these two parameters. 
# Refer to Overlay's documentation for how to use them:
# http://avisynth.org/mediawiki/Overlay

function FrostedGlow(clip c, float "blurstrength", float "opacity", string "mode")
{
blur = c.BlurMod(blurstrength) #[1]
Overlay(c,blur,opacity=opacity,mode=mode)
}

Now, onto the obligatory comparison example images.
Image
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
User avatar
Qyot27
Surreptitious fluffy bunny
 
Joined: 30 Aug 2002
Location: St. Pete, FL
Status: Creepin' between the bullfrogs

Re: FrostedGlow()

Postby 8bit_samurai » Wed Oct 06, 2010 11:27 pm

Who in their right mind would frost an amv with their glow?
Under Construction
User avatar
8bit_samurai
Hmm...
 
Joined: 17 May 2006
Location: Alaska

Re: FrostedGlow()

Postby Phantasmagoriat » Thu Oct 07, 2010 12:25 am

It has begun!

More people are starting to make custom effects with avisynth :o

It's nice to see the script in action. Kind of reminds me of something they did in the escaflowne movie at one point. And I vaguely remember seeing something like this in The Melancholy of Haruhi Suzumiya...? not sure though.

Just to make two suggestions, I would probably set some default values so that people can use FrostedGlow() out-of-the-box without remembering all the parameters. That, and I would clean up the header a bit:
Code: Select all
function FrostedGlow(clip    c,\
                     float  "blurstrength",\
                     float  "opacity",\
                     string "mode"  )
{
blurstrength = default( blurstrength, 1.0 )
opacity      = default( opacity, 1.0      )
mode         = default( mode, "Darken"    )

blur = c.BlurMod(blurstrength)
Overlay(c, blur, opacity=opacity, mode=mode)
}


That should make it so people can type:
Code: Select all
FrostedGlow()
and get the same result as
Code: Select all
FrostedGlow(blurstrength=1.0, opacity=1.0, mode="Darken")

and some tests:
Image
Image
Image
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≈☂

Re: FrostedGlow()

Postby Qyot27 » Thu Oct 07, 2010 10:22 am

Phantasmagoriat wrote:It's nice to see the script in action. Kind of reminds me of something they did in the escaflowne movie at one point. And I vaguely remember seeing something like this in The Melancholy of Haruhi Suzumiya...? not sure though.

Yeah, possibly the scenes in Haruhi where they're inside Closed Space. Sort of. Some of the configurations reminded me of the SHAFT version of Negima?!

Just to make two suggestions, I would probably set some default values so that people can use FrostedGlow() out-of-the-box without remembering all the parameters.

Yeah, that was something I didn't really feel like messing with last night, so I amended it in this morning from your suggestion, and revised some of the stuff in the comments to reflect the changes:

Code: Select all
# FrostedGlow, version 2010-10-07
#
# Applies blur to the clip, then blends the blurred clip back onto the original.
#
# Range of the effect varies according to the blend mode used; the name of the function
# derives from the appearance when using Darken mode at low levels (the function's default).
#
# Generally, colors get hazier while dark lines become more distinct, although the haze's
# brightness and the overall effect on color is dependent on the mode used.
#
# Requirements:
# BlurMod function by Phantasmagoriat
# gradfun2db
#
# Usage:
# FrostedGlow(clip c, float blurstrength, float opacity, string mode)
#
# All three of the function's parameters are the same as the options they
# correspond with in their source filters.
#
# 'blurstrength' acts the same as BlurMod(x), where 'x' is a float. 
# Recommended values for blurstrength are between 1 and 5, at least from my limited testing.
# Default is blurstrength=1
#
# 'mode' and 'opacity' control the way Overlay treats the video.
#
# 'mode' changes the method by which the blurred video is overlaid onto the source.
# Default is mode="darken"
#
# 'opacity' changes the degree of transparency of the blurred video.
# Default is opacity=1.0
#
# Refer to Overlay's documentation for more about the use of the 'mode' parameter,
# as well as a complete list of available modes:
# http://avisynth.org/mediawiki/Overlay

function FrostedGlow(clip c, float "blurstrength", float "opacity", string "mode")
{
blurstrength = default(blurstrength, 1.0)
opacity = default(opacity, 1.0)
mode = default(mode, "darken")

blur = c.BlurMod(blurstrength)
Overlay(c,blur,opacity=opacity,mode=mode)
}
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
User avatar
Qyot27
Surreptitious fluffy bunny
 
Joined: 30 Aug 2002
Location: St. Pete, FL
Status: Creepin' between the bullfrogs

Re: FrostedGlow()

Postby Phantasmagoriat » Thu Oct 07, 2010 3:18 pm

Actually, I think I was wrong about Haruhi-- they used more of a glow effect for what I was thinking of. Never watched Negima?! so I couldn't tell. However, it looks like they used something similar in Escaflowne for one scene:
Image
[Although this is more exaggerated, and has lighter lines]
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≈☂

Re: FrostedGlow()

Postby Scintilla » Thu Oct 07, 2010 5:37 pm

This kind of reminds me of the look you can get when using the TBilateral filter with a certain kernel (I think it's Huber's mini-max or Lorentzian?), just with more blurring. I call it the "Kare Kano episode 6" effect: everything in that one episode looks like a glossy pencilboard, not at all like the entire rest of the series.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

Re: FrostedGlow()

Postby LeX » Thu Oct 21, 2010 5:26 am

I just don't get how to do this >.>
User avatar
LeX
 
Joined: 21 Mar 2010
Status: M'king Music

Re: FrostedGlow()

Postby Phantasmagoriat » Thu Oct 21, 2010 1:00 pm

LeXxX wrote:I just don't get how to do this >.>
eventually it becomes second-nature

How to install a script-based avisynth plugin:
  • copy/paste the script into a .txt file,
  • rename to something like "FrostedGlow.avsi" [1]
  • put it in your avisynth plugins folder [2]
  • put any required .dll's or other scripts in your avisynth plugins folder [3], usually:
    C:\Program Files\AviSynth 2.5\plugins or
    C:\Program Files (x86)\AviSynth 2.5\plugins

[1] make sure you have file extensions showing on your computer first

[2] Alternatively, you don't have to put your plugins into your avisynth plugins folder,
but then you'll have to load your plugins manually by putting:
loadplugin("C:\PATH\..\FrostedGlow.avs") in your own script.

[3] In this case you will need the following [if you don't already have them]:

Then, in your own avisynth script, you can call FrostedGlow() like so:
Code: Select all
avisource("C:\PATH\TO\YOUR\VIDEO\...\video.avi")
FrostedGlow(blurstrength=1.0, opacity=1.0, mode="Darken")
Last edited by Phantasmagoriat on Thu Oct 21, 2010 5:09 pm, edited 1 time in total.
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≈☂

Re: FrostedGlow()

Postby LeX » Thu Oct 21, 2010 1:08 pm

Phantasmagoriat wrote:
LeXxX wrote:I just don't get how to do this >.>
eventually it becomes second-nature

How to install a script-based avisynth plugin:
  • copy/paste the script into a .txt file,
  • rename to something like "FrostedGlow.avsi" [1]
  • put it in your avisynth plugins folder [2]
  • put any required .dll's or other scripts in your avisynth plugins folder [3], usually:
    C:\Program Files\AviSynth 2.5\plugins or
    C:\Program Files (x86)\AviSynth 2.5\plugins

[1] make sure you have file extensions showing on your computer first

[2] Alternatively, you don't have to put your plugins into your avisynth plugins folder,
but then you'll have to load your plugins manually by putting:
loadplugin("C:\PATH\..\FrostedGlow.avs") in your own script.

[3] In this case you will need the following [if you don't already have them]:
-gradfun2db()
-BlurMod()
-and [possibly] ApplyonAngle() and rotate()


Then, in your own avisynth script, you can call FrostedGlow() like so:
Code: Select all
avisource("C:\PATH\TO\YOUR\VIDEO\...\video.avi")
FrostedGlow(blurstrength=1.0, opacity=1.0, mode="Darken")



Big thanks i got it :asd:
User avatar
LeX
 
Joined: 21 Mar 2010
Status: M'king Music

Re: FrostedGlow()

Postby Qyot27 » Thu Oct 21, 2010 4:39 pm

Phantasmagoriat wrote:-and [possibly] ApplyonAngle() and rotate()

It works without ApplyonAngle present. I can't remember if I had Rotate in the folder when doing the test, though. I would surmise that not needing ApplyonAngle means Rotate isn't needed either. If not, just move it back in.

And remember to get the amended version I posted later (viewtopic.php?p=1349400#p1349400), as that has the defaults already set. I'll also reiterate that the filter does more than the default effect, like I showed in the comparison images, and that using the names of the parameters isn't necessary. I usually don't use them, so FrostedGlow(blurstrength=5,opacity=0.75,"multiply") is the same as FrostedGlow(5,0.75,"multiply"). Or a simple FrostedGlow(), which is the same as FrostedGlow(1,1.0,"darken").
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
User avatar
Qyot27
Surreptitious fluffy bunny
 
Joined: 30 Aug 2002
Location: St. Pete, FL
Status: Creepin' between the bullfrogs

Re: FrostedGlow()

Postby Phantasmagoriat » Thu Oct 21, 2010 5:08 pm

Qyot27 wrote:It works without ApplyonAngle present. I can't remember if I had Rotate in the folder when doing the test, though. I would surmise that not needing ApplyonAngle means Rotate isn't needed either. If not, just move it back in.
I was too lazy to check. *checks now*
yup. ApplyonAngle and Rotate are not required. :dino:
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 1 guest