DeRainbow() - "There is no such function" whhaaaaat??

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Rider4Z
The Machine
Joined: Sun Dec 14, 2003 3:55 am
Status: You just got Holtzmanned baby~
Location: One floor above Chinese take out
Contact:
Org Profile

DeRainbow() - "There is no such function" whhaaaaat??

Post by Rider4Z » Mon Aug 31, 2009 5:53 pm

lol okay i'm taking this from A&E's Technical Guides to All Things Audio and Video (v3) Improving Visual Quality and Compressibility
There exist a number of different filters and functions designed to combat rainbowing, but many of them are old and outdated or just don't work all that well. I have decided on just two methods of rainbow removal that I believe work very well for pretty much all situations.

DeRainbow: This is a function written a few years ago by Sh0dan which is excellent at removing rainbows. It works by creating a mask of the edges in the video, then smoothing the chroma channel of these edges both spatially and temporally. This works extremely well and with few side effects. You should note however, that it can case some slight discolorations around edges, especially if you use a high threshold. The default threshold for rainbow removal is 10, and you can increase or decrease this value as you deem necessary by calling this function like so:

DeRainbow(10)
well there it is, but dagnabbit when i try it i get the infamous error message from VirtualDub "There is no such function"

what the crap did i do wrong? herupu me puri-zu

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

Re: DeRainbow() - "There is no such function" whhaaaaat??

Post by Scintilla » Mon Aug 31, 2009 8:35 pm

It's a script function. It was included in the older versions of the AMVapp (though it may have had the name SDDeRainbow (to make it clear that it's Shodan's, as other people have also written functions named DeRainbow), so try that instead), and it should be in the newest version as well... right?
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Re: DeRainbow() - "There is no such function" whhaaaaat??

Post by Phantasmagoriat » Mon Aug 31, 2009 8:53 pm

Do you have the file "DeRainbow.avsi" in your avisynth plugins folder?

if not, you can copy and paste the following into a .txt file, and rename it "DeRainbow.avsi"

Code: Select all

function DeRainbow(clip org, int "thresh")
{ 
  assert(org.isYV12(),"DeRainbow() requires YV12 input!")
  thresh = default(thresh, 10)

  org_u = utoy(org)
  org_v = vtoy(org)

  msharpen(org, threshold = thresh, mask=true)
  reduceby2()
  greyscale()
  uv = blur(1.5).levels(0,2.0,255,0,255, coring=false).blur(1.5).blur(1.5).levels(50,2.0,255,0,255, coring=false)

  filtered_u = org_u.blur(1.5).blur(1.5).blur(1.5).temporalsoften(2,255,0,3,2)
  filtered_v = org_v.blur(1.5).blur(1.5).blur(1.5).temporalsoften(2,255,0,3,2)

  u_final = mt_merge(org_u, filtered_u, uv)
  v_final = mt_merge(org_v, filtered_v, uv)

  return ytouv(u_final, v_final, org)
}
be aware that DeRainbow() is basically a function made out of other functions, so in order for it to work, you will need all of those too.
Image
Org Profile | AMVGuide | Phan Picks! | THE424SHOW | YouTube | "Galactic Escape"

"Effort to Understand; Effort to be Understood; to See through Different Eyes."

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

Re: DeRainbow() - "There is no such function" whhaaaaat??

Post by mirkosp » Tue Sep 01, 2009 12:56 am

Derainbow is terribad since it washes out chroma everywhere even with a strength of 1. >_>
I prefer the LUTDeRainbow by our very own Scintilla. :D
Though it tends to miss some rainbows even at settings stronger than recommended, it's a rare occurence, and tends to successfully remove most of the rainbows without other downsides. I found it to work much better than BiFrost even if both are just temporal.
By the way, moved to the AviSynth section.
Image

User avatar
Rider4Z
The Machine
Joined: Sun Dec 14, 2003 3:55 am
Status: You just got Holtzmanned baby~
Location: One floor above Chinese take out
Contact:
Org Profile

Re: DeRainbow() - "There is no such function" whhaaaaat??

Post by Rider4Z » Tue Sep 01, 2009 9:56 am

THANKS VERY MUCH! i'll try these suggestions and keep you updated on my success/failure

User avatar
Rider4Z
The Machine
Joined: Sun Dec 14, 2003 3:55 am
Status: You just got Holtzmanned baby~
Location: One floor above Chinese take out
Contact:
Org Profile

Re: DeRainbow() - "There is no such function" whhaaaaat??

Post by Rider4Z » Fri Sep 04, 2009 12:46 am

Scintilla wrote:It's a script function. It was included in the older versions of the AMVapp (though it may have had the name SDDeRainbow (to make it clear that it's Shodan's, as other people have also written functions named DeRainbow), so try that instead), and it should be in the newest version as well... right?
turns out that's all i needed. most of the rainbows were eliminated :up:

thanks very much everybody :D

Locked

Return to “AviSynth Help”