Avisynth DeRainbow
DeRainbow is a simple script that reduces rainbows, the shimmering colour artefacts over fine patterns.
Filtering → Avisynth → DeRainbow

What it does
The script builds an edge mask from the luma (an MSharpen mask). Heavily blurred and temporally softened U and V planes are then blended into the original chroma, but only where the mask allows. Lines and edges keep their colour; the rest of the chroma is smoothed.
Requirements
- Windows, CPU only.
- The plugins the script needs (masktools2, MSharpen) are shipped with Hybrid.
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Threshold | thresh | 1–254 | 10 | MSharpen threshold of the edge mask. Lower values filter a larger area and catch more rainbow, but can also remove real colour detail. |
Example
Default settings on a 10-bit YUV 4:2:0 source. Hybrid converts to 8 bit before the filter and back to 10 bit afterwards:
# chroma denoising using DeRainbow # Converting from 10 to 8bit for DeRainbow ConvertBits(8) DeRainbow() # Converting from 8 to 10bit for encoder ConvertBits(10)
How Hybrid calls it
- Hybrid loads masktools2 and MSharpen, imports
DeRainbow.avsand callsDeRainbow. - The script works on 8-bit YV12 only; the width and height must be multiples of 4. Other formats and bit depths are converted before the filter and back afterwards.
threshis only written when it is not 10.- The script is not interlace-aware; for interlaced sources Hybrid processes the fields separately.
- DeRainbow also offers the common options and can be added to the filter queue several times.
Background
- DeRainbow.avs is a short script without author or version in its header. Its steps: MSharpen edge mask, reduce by 2, convert to grey, blur and levels to get the chroma mask; U and V are blurred three times and softened with TemporalSoften(2, 255, 0, 3, 2); the planes are merged through the mask.
See also: BiFrost, DFM DeRainbow
Sources
- The AviSynth+ documentation does not cover DeRainbow.
- Hybrid's tooltips