From Avisynth wiki
Jump to: navigation, search
Author Scintilla
Version 10/3/08
Download LUTDeRainbow-20081003.avsi
Category Rainbow & Dot Crawl Removal



LUTDeRainbow, a derainbowing script by Scintilla.


Required Plugins

Syntax and Parameters

LUTDeRainbow(clip input, float "cthresh", float "ythresh", bool "y", bool "linkUV", bool "mask")

clip  input =
Input clip.

float  cthresh = 10.0
This determines how close the chroma values of the pixel in the previous and next frames have to be for the pixel to be hit.
Higher values (within reason) should catch more rainbows, but may introduce unwanted artifacts. Probably shouldn't be set above 20 or so.

float  ythresh = 10.0
If the y parameter is set true, then this determines how close the luma values of the pixel in the previous and next frames have to be for the pixel to be hit. Just as with cthresh.

bool  y = true
Determines whether luma difference will be considered n determining which pixels to hit and which to leave alone.

bool  linkUV = true
Determines whether both chroma channels are considered in determining which pixels in each channel to hit.
When set true, only pixels that meet the thresholds for both U and V will be hit.
When set false, the U and V channels are masked separately (so a pixel could have its U hit but not its V, or vice versa).

bool  mask = false
When set true, the function will return the mask (for combined U/V) instead of the image. Formerly used to find the best values of cthresh and ythresh.
If linkUV=false, then this mask won't actually be used anyway (because each chroma channel will have its own mask).


LUTDeRainbow with default settings:

LUTDeRainbow(cthresh=10.0, ythresh=10.0, y=true, linkUV=true, mask=false)


     - Fixed "cthresh" typos in documentation; killed repmode since I realized I wasn't using Repair anymore; finally upgraded to MaskTools 2.
9/2/05: - Suddenly realized this wouldn't work for YUY2 and made it YV12 only; added linkUV option, to decide whether to use a separate mask for each chroma channel or use the same one for both.
7/1/05: - Added Y option, to take luma into account when deciding whether to use the averaged chroma; added ythresh and cthresh parameters, to determine how close the chroma/luma values of a pixel have to be to be considered the same (y=true is meant to cut down on artifacts)
6/24/05: - Replaced whole mask mechanism; new mask checks to see that BOTH channels of the chroma are within the threshold from previous frame to next
6/23/05: - Is this thing on?

Back to External Filters

Personal tools