Log in

View Full Version : "rainbow edges" filter: is it possible?


OUTPinged_
4th September 2002, 17:16
"shimmering rainbow edge" effect is pretty common on anime dvd. even more recent titles like tv bebop have this issue.

AFAIK there were VHS recorders that were able to correct that problem so writing a filter should be possible.

I can provide screenshots/sample clips with that artefact if needed.

(no, filters like dnr2 dont help :/ )

What i want to know is how hard can it be to write an algo that will remove most of that ugly rainbows?

Marc FD
4th September 2002, 17:58
can you describe much, provide screenshots, ect...

i don't see exactly what's your problem.
i will take a look, to see if it's possible to filter it.

Defiler
4th September 2002, 17:58
I use MSmooth and/or WNR (from the "Wavy Yellow Lines" thread) to scrub these out. It would be nice to have something more specific, though.. because they occasionally occur in "normal" TV captures as well, and MSmooth isn't designed to work on those.

Defiler
4th September 2002, 18:05
Here's an example screenshot.
This is a "typical" level of "rainbowing."
rainbow.png (http://hellninjacommando.com/misc/avisynth/rainbow.png)

Marc FD
4th September 2002, 19:09
whow !! never saw that. i think a color normalisation algo could work.
the problem is, that i don't have samples of that on my computer, and my connection is very slow.
if you could manage to compress a clip in XviD avi. size less than 500 Ko, i could dl it (shrink it to few seconds. you can even do a compilation of several different sources in a clip)

LigH
4th September 2002, 19:52
Maybe a "Chroma Noise Reduction" helps? Especially anime usually have flat colors or smooth ramps.

zettai
4th September 2002, 19:53
Donald's site has a link to Tim Park's adaption of smart smoother which works on chroma to reduce the effect of cross-colouration (rainbowing)

it's a vdub filter

Suzahara
4th September 2002, 22:36
There's a filter to get out rainbowing call SSiQ, sorta related to SSHQ, you'll find it on Donald Graft's page I believe.

Whoops, got beat by zettai by a little ;)

OUTPinged_
5th September 2002, 06:30
About ssiq.

1. it is _slow_ (3second/frame)
2. it doesnt filter out my test clip.



I will provide url for a test clip in a couple of hours.

Didée
5th September 2002, 08:28
Well, those beloved rainbow artefacts :devil:

I found they can be eliminated with something like

chroma=BilinearResize([HalfDimensions]) # shrink movie to half resolution
chroma=Convolution3d(chroma,1,8,8,8,8,255,0)_# have to play with these parameters!
chroma=BicubicResize(chroma,[FullDimensions],0.333,0.333) # or even 0.5,0.25
MergeChroma(chroma)

It seems like sledge-hammering chroma, but for me, it works astonishing good. Except for speed ...
Have a try, play, and decide if the loss in chroma is acceptable.

sh0dan
5th September 2002, 08:39
@Didée: You could use reduceby2() for shrinking - result is much like bilinearresize, but it's much faster!

Marc FD
5th September 2002, 11:49
in fact this rainbow seems to be a sort of Hue alteration with extreme luma/saturation values. i think a colornormalizer would work. i would code it fast (in C) and attach it. just a day or two...

Didée
5th September 2002, 11:56
Sh0dan:

Yep.

But for fine-tuning this "rainbow-removal", it often requires other shrinking than exactly /2 - sometimes more, sometimes less. So I let the resize command stay for the ease of tuning.

And this method is quite slow, so there is not that much to gain by ReduceBy2(). Perhaps this would warp the framerate by 1 FPS (?).
The main point is, (for me), rainbow removal is necessary with TV captures only. And for TV caps, I everytime have an ConvertToRGB().[LogoRemoval].ConvertBackToYUY2() in the script. This brings my AthlonXP 1800 down to approx. 5-9 FPS, depending on what additional filters are involved. So encoding is always done from [GoingToBed] til [ReturningFromJob].

Just to explain myself.
Of course, you are absolutely right, sh0dan.

Defiler
5th September 2002, 13:42
I made a 1MB XviD sample. I wanted to give you an entire "scene", and the 500KB test introduced so many artifacts of its own that I thought it would no longer make a good test clip for you.
rainbow.avi (http://hellninjacommando.com/misc/avisynth/rainbow.avi)

OUTPinged_
5th September 2002, 14:19
Defiler, can you please make a huffy version available?

In my tests the rainbow filtering filters acted pretty lame when being feed a divx source.

I still can't host my sample clip until DG will get his "interlaced mouth" one and it looks like it can take time.

Defiler
5th September 2002, 14:59
Sure.. but a Huffy version of all 150 frames might be a bit large. Do you have a range (out of that clip) that you'd like to see?
Edit: I posted a Huffyuv version for people with fast connections. If you just want to see a few frames, let me know which ones.
all 150 frames (http://hellninjacommando.com/misc/avisynth/rainbow-huffy.avi)

OUTPinged_
5th September 2002, 15:31
150 frames are definitely overkill.

60-70 frames are enough.

Marc FD
5th September 2002, 16:41
i will try to filter this. i have a good idea... Hue blur and Saturation Normalisation with Luma trigger...

OUTPinged_
5th September 2002, 17:53
Well the problem here is that this is VHS artifact and it is altered in a process of "digitalizing". I mean the fields are blurred a bit and ivtc process helps there too :-(

There is an article on why that stuff does occur, it is here,

http://engel.otaku.ru/lab/dvd/dvdq_3.html

But is written in russian. The pictures speak for themselves though. I can write a quick translation to english here if needed.

High Speed Dubb
5th September 2002, 20:04
I wasn’t able to download the codec for the video, but the .png file does look like cross-color problems.

The best way to correct for this is to
- Detect regions with lots of color crosstalk, then
- If the area does not show motion, average between the pixel in the current frame and its value 1 frame back (for NTSC) or 2 frames back (for PAL).
- If the area does show motion, check for vertical detail. If there isn't too much detail in the area, average with the line up or down one (for NTSC) or two (for PAL) in the current field.
- If it shows motion and vertical detail, punt.

I wrote up a filter which does the first and second (and fourth ;) ) of those tasks for DScaler. The code and comments are at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/deinterlace/DScaler/Plugins/FLT_TemporalComb/

Beware that the PAL code in it is experimental, and needs some work.

OUTPinged_
5th September 2002, 20:58
./me waits for avs plugin with his "Gloves of l33t plugin grab +1" on..

High Speed Dubb
6th September 2002, 01:09
@OUTPinged,

I just noticed that you’re in Lithuania. Do you know if you’re getting SECAM or PAL video?

Guest
6th September 2002, 05:42
I know!

Lithuania uses (K1) SECAM, according to ITU-R BT.470-3 (1994).

Just one of those little trivia items I picked up somewhere. :)

Koepi
6th September 2002, 05:47
LOL! :)

Donald, you sure should have some glasses of wine more often!

Now this is a creative mood :)

Best regards,

and (sorry, 7a.m. here) no more cheers for now ;)

Best regards,
Koepi

High Speed Dubb
6th September 2002, 06:06
The difficulty with SECAM is... It uses a completely different way to encode color information. So it has its own unique kinds of color artifacts, and the stuff I wrote about correcting color crosstalk wouldn’t help a bit.

Then again, it’s possible that the VCR encodes in PAL, and only converts to SECAM on input and output, or something else odd like that.

OUTPinged_
6th September 2002, 10:07
We have switched to PAL half a year ago :-(

Our anti-russian freaky government ordered to switch because "russia uses SECAM and usa/europe uses PAL that means PAL is better"

Yes, it is _that_ bad.

Defiler
6th September 2002, 13:49
Just in case it's still relevant, here's a 60-frame (Huffy) snip of the test footage. Much smaller. :)

60 frame sample (http://hellninjacommando.com/misc/avisynth/rainbow-huffy-60.avi)

Guest
6th September 2002, 14:34
@OUTPinged_

But USA doesn't use PAL!

High Speed Dubb
7th September 2002, 04:51
@Defiler,

Thanks for the clip — The characteristic every-other frame pattern is very clear, there.

By the way — We’ve only been talking about half of the problem, here. The other half is dot crawl, such as
http://students.washington.edu/ldubb/computer/CNNWithoutTemporalComb.JPG
(Take a look at the red stuff in the weather map and logo.)

I’ve got a request. Could someone with PAL video please make a clip similar to Defiler’s? I’ve been trying to get a filter to work on PAL material, but have had to base everything so far on the PAL specs. Looking at some real video would make things much easier.

Thanks very much!

OUTPinged_
7th September 2002, 06:32
@DG

That doesn't matter to them.

Anyway, they have switched already. I have a feeling like TV studios are low on bitrate now :-)

Defiler
7th September 2002, 14:13
I have a pretty reasonable amount of PAL video, but I don't recall any of it having nasty rainbows like that. If I run into some, I'll make a short(er) sample.

OUTPinged_
7th September 2002, 19:08
I am requesting a filter to remove rainbows that i am finding after DVD mastering.

Rainbows only occur when non-beta tape was used as a source (ie VHS).

High Speed Dubb
9th September 2002, 02:21
@Defiler,

Many thanks. Recorded material should generally not show as much crosstalk as over the air stuff, so it may be relatively hard to spot it in your collection. If you’re using a DVD player, be sure to connect it via composite, since that will cause much more crosstalk.

There are a couple places to keep an eye open for it. Cross color problems show up most often with high frequency luma (like the lettering you saw, or in an Oxford shirt) as rainbows, or in sharp saturated chroma boundaries (especially in computer graphics and animation) as dot crawl. If you have a reference DVD, try a color bar pattern via composite — That’s sure to cause lots of dot crawl.


@OUTPinged,

I take it that you’re not using any over the air source. Color crosstalk isn’t just a tape artifact.

anGGa
23rd November 2002, 07:42
Hi,

I get this rainbow colors on a "normal" movie and I think it has something to do with using Avisynth for frameserving, since I dont get it using VFAPI :(

Any Ideas?

Thnx for ur help...

OUTPinged_
23rd November 2002, 11:56
@anGGa

Try to read all that people written there, your question was already answered.