Previous topicNext topic

Control colours

Suggestions for new features for Magic.
Post Reply
Reigel
Posts: 81
Joined: Sun Mar 15, 2015 9:56 am

Control colours

Post by Reigel »

What I really would like to have is some means to control the often overwhelming colours of some shaders (or whatever source). I think of something like setting a range into which all the original colours are compressed. A lot of shaders cycle through the entire colour wheel. Instead I would like to compress this to e.g. the green and blue colour palette only.
If combined with a sort of shifter which moves the center of this range I could much better control and determine the resulting colouring of my scenes.

Best
Reinhard
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Control colours

Post by Magic »

I think you could just use any of the color modules to do that. For example:
OnlyBlue.jpg
OnlyBlue.jpg (101.95 KiB) Viewed 5939 times
I set both the Red and Green parameters to 0, so only blue remains.
Terry Payman
Posts: 711
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Control colours

Post by Terry Payman »

Eric wrote:I think you could just use any of the color modules to do that...
IMHO and with the greatest of respect I don't think this would achieve the requested functionality. Input animation/cycling in certain colour ranges (between green and red in the example given) would give a static if not invisible output.

I believe this needs a RGBtoHSV conversion, then H-scaling and H-offset (and clamping), then HSVtoRGB. A perfect application for an ISF module, and I notice that the example HSVtoRGB.fs contains both RGBtoHSV and HSVtoRGB functions. I'd have a go at hacking it myself but I'm much too busy at the moment.

I think it could be useful to expand the hue range as well as compress it, also to offer the same control over saturation and luminance ranges.
Reigel
Posts: 81
Joined: Sun Mar 15, 2015 9:56 am

Re: Control colours

Post by Reigel »

Hi Terry,

that is exactly what I feel: Using the RGB sliders does not translate a wide colour range into a narrow one.
Thanks for the hint with HSVtoRGB.fs. I will check out if it hewlps me. Sounds promising. Unfotunately I am not familiar in writing my own ISF modules or hack an existing one. So any hint or help is very welcome.

Best
Reinhard
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Control colours

Post by Magic »

I think what you are really asking for is some kind of brightness/contrast adjustment, but on a per-channel basis. It could be done on either the RGB channels, or the HSV channels.

The mathematical operation would be a simple linear calculation of the style y = ax + b, where x is the input color channel (r/g/b/h/s/v), a is the contrast (>1 would be more contrast, <1 would be less), b is the brightness (which can be positive or negative), and y is the output color channel.

The ColorRGB module accomplishes the contrast aspect as I suggested in my earlier post, although it only lets you scale by less than 1 (not greater than), but I don't think you need that anyway.

For the brightness aspect, there is an ISF effect called "Channel Slide".

So you just have to connect the modules as follows:
Your shader module -> ColorRGB -> Channel Slide

Here's an example:
CompressedShiftedRed.jpg
CompressedShiftedRed.jpg (102.72 KiB) Viewed 5902 times
I "compressed" the Red channel by .25 so it goes from 0 to .25, and then I "slid" it by .5 so it goes from .5 to .75.

If you want to do it in HSV space instead of RGB, just do:
Your shader module -> RGBtoHSV -> ColorRGB -> Channel Slide -> HSVtoRGB
In this case, the RGB processing (in ColorRGB and Channel Slide) would actually be in HSV.

These methods are the only ways to accomplish what you're asking, because Magic has no control over what colors go into the shaders (with the exception of any input they require). The only improvement would be to combine some of the RGB/HSV effects into one effect, which would be a slight speed advantage.

Does that all make sense? It hope it wasn't too technical :).
Reigel
Posts: 81
Joined: Sun Mar 15, 2015 9:56 am

Re: Control colours

Post by Reigel »

Thanks for Your thoughts.

I will experiment on Your proposals. And I am confident to achieve some progress in what I am looking for. I still feel that reducing contrast is not what I am looking for. I do not want to get the images flaw. But I may be wrong. Hands on will proof it.

Thanks
Reinhard
Reigel
Posts: 81
Joined: Sun Mar 15, 2015 9:56 am

Re: Control colours

Post by Reigel »

Hmm, now I tried all of Your suggestions and some more. It all does not come out as I want it. Maybe I am wrong thinking. But in After Effects I can get something in that direction I think. I will play a little bit and tell You if something serious comes out.

Reinhard
Post Reply