6th April 2006 21:00 UTC
saturation?
any hint how to increase the saturation of the colors of a preset? or will anybody do a tiny ape for this? ;)
Archive: saturation?
Yathosho
6th April 2006 21:00 UTC
saturation?
any hint how to increase the saturation of the colors of a preset? or will anybody do a tiny ape for this? ;)
Kar-mAVS
6th April 2006 22:04 UTC
It probably isnt the best solution, or the fastest or the anything, but if you put:
level:
red=(red-(((1-red)+(1-green)+(1-blue))*0.33))*2;
green=(green-(((1-red)+(1-green)+(1-blue))*0.33))*2;
blue=(blue-(((1-red)+(1-green)+(1-blue))*0.33))*2;
into the colour modifier it maxes the saturation (sorta).....
^_^ I guess for a subtler effect you could do
red=((red-(((1-red)+(1-green)+(1-blue))*0.33))*2)*0.5+red*0.5;
green=((green-(((1-red)+(1-green)+(1-blue))*0.33))*2)*0.5+green*0.5;
blue=((blue-(((1-red)+(1-green)+(1-blue))*0.33))*2)*0.5+blue*0.
someone (not me...) needs to optimise this...
StevenRoy
7th April 2006 05:41 UTC
The Color Modifier calculates red, green, and blue simultaneously. This means that, before the equation is processed, the "red", "green" and "blue" variables are set to the same values, so your code won't work the way it's intended to. That also means you can't mix channels with that effect.
Programming an APE to do this would work, assuming there's still anyone out there who knows how to program a decent APE.
For an effect similar to this, I think a "Color Map" could be a good approach. Use (R+G+B)/3 as the input, set the output to one of the "Subtractive" modes (I forget which is correct), and give it a black to gray gradient. (0,0,0 to 128,128,128.) This will make the image darker, so you'll want to follow that with a Trans/Multiplier (2x) to fix the brightness.
Alternatively, it might be possible to use the Trans/Colorfade effect to do the same thing, but, frankly, that thing scares me.
PAK-9
7th April 2006 10:18 UTC
You should be able to do it 'properly' with a color modifier. You need to convert the RGB to HSL, increase S and convert back to RGB. I have some code to convert HSL->RGB but not the other way around, I will paste it later when i get home (i might just write the color mod).
ASD5A
7th April 2006 14:18 UTC
it doesnt work with color mod since you cannot
use all three channels for calculations.
i.e. red=red*0.33+blue*0.33+green*0.33 wouldnt work.
and you need to use all three channels to convert rgb to hsb or hsv
Grandchild
7th April 2006 15:30 UTC
Originally posted by StevenRoyColor Modifier can do sth like this all in one.
I think a "Color Map" could be a good approach. Use (R+G+B)/3 as the input, set the output to one of the "Subtractive" modes, give it a black to gray gradient. This will make the image darker, so you'll want to follow that with a Trans/Multiplier (2x) to fix the brightness.
Yathosho
9th April 2006 00:20 UTC
cheers
StevenRoy
9th April 2006 23:16 UTC
Color Modifier can't mix channels. That's the problem. It works like some paint programs' "Curves" function. You can alter brightness and contrast, gamma, invert, solarize (AKA "chrome"), posterize (AKA "color reduction"), and all sorts of similar effects, but you can't mix channels with Color Modifier!
Should I go into more detail about why this is?
For that reason, you also can't convert RGB to HSL in a Color Modifier, or back again. The closest you can come to increasing saturation would be increasing the contrast instead. (Although that could be close enough in most situations, as excellently demonstrated by the "saturation" preset posted above by Grandchild.)
Color Map, on the other hand, can do channel mixing. You can specify "(R+G+B)/3" as an input, and set the output mode to "Subtractive 1", which gives you something very close to the before-mentioned "(((1-red)+(1-green)+(1-blue))*0.33". From there, it's just a matter of finding the right gray value to get the effect you want, and then correcting the brightness afterward (equivalent to the *2 at the end of the equations Kar-mAVS posted here).
I'm attaching a preset that demonstrates this technique for increasing saturation. Note that it demonstrates three different strengths of the effect, too, and you can click the mouse to select them. This is explained a little more in the comment.
Hope this helps.
PAK-9
10th April 2006 12:37 UTC
oops, forgot about this. Yea I did the code for RGB->HSL->RGB in a colour mod but as people are pointing out it doesn't work.
You would have to paste the code into every place you do a render (assuming it is a codable component). I blame UnConeD for making colormod poo :P
Would be best as an APE as you suggested originally
shreyas_potnis
11th April 2006 15:17 UTC
ok, i've got lots to learn here.
why does doing something like red=blue in colour modifier cause no change?
i was expecting the entire red channel to change.
obviously i am missing something.
Grandchild
12th April 2006 13:10 UTC
the magic words here are hidden in the
AVS Color Modifier - Expression Help:which means that red can only take the values of red for reference.
"The color modifier allows you to modify the intensity of each color channel with respect to itself."
fsk
12th April 2006 21:07 UTC
i suck at expaining things but ill try anyway:).
code in color mods level box:
red=red*.2;
green=green*.6;
blue=blue*.5;
now some pseudo code on what happens:
for(i=0;i<256;i++)
{
red[i]=max(0,min(round(i*.2),255));
green[i]=max(0,min(round(i*.6),255));
blue[i]=max(0,min(round(i*.5),255));
}
then color mod goes over every pixel and does this:
red=red[red];
green=green[green];
blue=blue[blue];
this is as far as i can explain it:D.
eheiney
13th April 2006 06:26 UTC
While we're all talking about colors, what's the square root of orange? :p
fsk
13th April 2006 07:26 UTC
what's the square root of orange?16,11,0 :P
Fork me on GitHub