Log in

View Full Version : New Filter: Gradation Curves v1.10


BBugsBunny
11th January 2004, 19:36
I've developed a new filter that can edit the gradation curves similar to curves of painting programs.

The filter is downloadable here:
https://neosol.at/vdub/index.html

What the filter can do / what the filter can be used for: For example if dark areas of a video are too dark, the filter can be used to brighten them up, without changing light and mid tones. The filter can invert the color space like the internal invert filter and can apply coring also, like the coring filter plugin that exists for VirtualDub. If the tone of a video is, for example too blue, the filter can be used to compensate this. The overall brightness can be changed also. And the good thing is, it can all be done at the same time with one filter instance only.

This way I also want to thank Phaeron for helping & showing me how to store the gradation curves data in the processing settings (.vcf file).

Changes to v1.0:
* An import/export function has been integrated to import/export curves from/to Adobe Photoshop. (Map Files .amp can be saved in the curves function of Adobe Photoshop by selecting pen mode.)
* A small bug in the weighted mode is now fixed.

Dali Lama
14th January 2004, 15:26
Hi,

That looks like a realy nice filter for poorly lit DV videos. Thanks a lot! I am sure many people will appreciate this filter. I just hope people in the DV forums find out about this :)

Thanks,

Dali

trevlac
20th January 2004, 19:07
@Bugs,

Why do you use the 709 spec numbers to calculate Y? 54,183,19

It is my understanding that 601 is Std TV, and the numbers would be something like 77,150,29.

The reason I ask is that I'm working on a color correction scope plugin (histograms/wfm/hot pixels/channels), that really does not fix anything, just shows what you have in a more objective fashion. The appropriate use of the specs and the range for RGB (aka 16-235 vs 0-255) has me puzzled.

Your curves tool would be a great compliment, letting one fix most things in 1 shot.

Here is a link with more info:
http://www.video-demystified.com/mm/tutor/ch03.pdf

BBugsBunny
20th January 2004, 21:52
@trevlac,

actually I got the values from the internal greyscale filter of VirtualDub.

The "normal mode" works similar to Photoshops curves, but as I found out, that setting more extreme values can give some rather strange effects, I thought of a "weighted mode". So first I had (R+G+B)/3. Then I took a look at the internal assembler routine of the greyscale filter of VirtualDub, that says in a comment:
"Y = (54 * R + 183 * G + 19 * B)/256"
I thought it would be better than (R+G+B)/3 and at that point I've read no specs about Y calculation.
Now I've taken a look at a Rhode&Schwarz info paper about TV technology and there it says something like 77,151,28 as well.
So perhaps anyone else knows why VirtualDub uses 56,183,19 and if 77,151,28 would be more correct?
I could change this in an upcoming release easily...

At the moment I'm trying to integrate a possibility to edit the curve with the mouse - but this seems to be not so easy (at least for me).

trevlac
21st January 2004, 16:28
Originally posted by BBugsBunny
So perhaps anyone else knows why VirtualDub uses 56,183,19 and if 77,151,28 would be more correct?


The actual 601 spec document says Y = 77/256 + 150/256 + 29/256.


You can also speed up the calculation by storing the pre calculated values in 3 256 dim arrays. Then you do something like

//** Init proc
for(i=0;i<256;i++) {
RedY[i] = i*77;
GreenY[i] = i*150;
BlueY[i] = i*29;
}
....
//** main proc
Y = (RedY[Red] + GreenY[Green] + BlueY[Blue])>>8


I don't recall if you did this. I slapped my head when I 1st saw this technique and said 'of course'. I posted because I didn't know this until recently.

BBugsBunny
21st January 2004, 19:02
I've updated the filter to version 1.11

This fixes the bug of the out-of-bounds memory access (access violation) when storing the processing settings.
Also I changed the Y calculation to:
Y = (77 * R + 150 * G + 29 * B)/256