View Full Version : Adjust one RGB value by XX%
Soulhunter
20th July 2003, 19:17
Hi everybody,
I have a "small" question about color adjustment in AviSynth...
How could I reduce a special color (Red...or else) by let the rest of thi Image untouched?
I read the descriptions... RGB Adjust does not help I think), because it just reduces/boost the colors with an "multiplier" without taking respect to the rest... (cant explain it well, but I will try) >When white gets reduced in red it goes "green/blue"< I dont want to reduce the whole red color in the picture, I just want to rduce the red color in the red parts of the picture... So that all colors left as they where before exept the red parts (they should get darker... "brown" or so)
a.) Is it possible to change one RGB value by an %, without change the rest of the picture (reuce bleu by 50%, but only in blue arears) ???
b.) When... Is this also possible with YV12 (without color conversation)???
Bye
cheap-red-wine
20th July 2003, 19:52
Hue/Saturation/Intensity filter for VirtualDub can restrict operation to certain colors.
Soulhunter
26th July 2003, 21:26
Yeah! But...
I'm looking for something like this option...
--------------------------------------------------
Color-balance;
Red -255.....0.....+255
Green -255.....0.....+255
Blue -255.....0.....+255
--------------------------------------------------
or maybe like this...
--------------------------------------------------
Color-balance;
Red -100%.....0.....+100%
Green -100%.....0.....+100%
Blue -100%.....0.....+100%
--------------------------------------------------
With a funktion where you chose the color "in the picture" that I want to change...
--------------------------------------------------
Example;
Red(0,0,0) #leaved untouched
Green(+50,0,0) #Force red in the green parts of the picture
Blue(0,-50,0) # Reduce green in the blue parts
--------------------------------------------------
Bye
neily
27th July 2003, 01:06
Soulhunter,
I think I understand what you want, but it is difficult to achieve, whether AVISynth presently has the functionality or not. What I assume you want is something akin to the functionality of the Selective Colour command in Photoshop, where you are given the option to alter the CMYK values of components such as reds, yellows, mid-greys etc. However, even in Photoshop, you have little control. It is not clear how the components are derived.
Your example above is precisely what RGBAdjust does. How do you suggest differentiating between the red component of a red pixel and the red component of a grey pixel. At some stage you need to make a choice as to which pixels to affect, which ultimately means having to use Mask and Layer.
In AVISynth, you would have to create a mask specifying the range of colours you wish to affect, then create an image that when layered onto the original with the specified mask produces the effect you want. If the mask can be simply black and white, then ColorKeyMask is the simplest way to go, otherwise you will have to fiddle around with RGBAdjust, GreyScale and Levels, though this is not very effective. What is really required is a ColorKeyMask which results in a proportional mask.
I had been giving your problem some thought, the progress on which, thanks to the efforts of others, especially Richard Berg and WarpEnterprises, can be seen in the following threads:
http://forum.doom9.org/showthread.php?s=&threadid=58098
http://forum.doom9.org/showthread.php?s=&threadid=58246
http://forum.doom9.org/showthread.php?s=&threadid=58184
You will require the latest dll hyperlinked in the last thread. An example script to tone down reds,as defined by a simple ColorKeyMask, of "clip1" is:
maskclip=ColorKeyMask(clip1,$FF0000,80).Invert("A")
adjustclip = BlankClip(clip1,color=$FFFFFF).Mask(maskclip)
Layer(clip1,adjustclip,"subtract",level=32)
You should also have a look at Mud Funky's experiments in blue/green matting, which are quite relevent:
http://forum.doom9.org/showthread.php?s=&threadid=56277
Soulhunter
28th July 2003, 21:15
THX for the help neily ! :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.