PDA

View Full Version : Colour reduction 2



NorthernLights
May 29th, 2005, 12:31 PM
Some might remember my last thread on colour reduction when I, with the help of you all, created a stylizing effect. I'm still working on the same editing project actually, and this time I'm trying to figure out how to grayscale an image with the exception of strong green colours. Sound confusing enough?

I'm looking for a way to keep the green parts of the image as they are, but grayscaling the rest. So in other words, where the G channel has a higher value than the RB it should be kept as it is, otherwise it should be grayscaled. Furthermore, to prevent the edges between gray and green being too hard, I'm looking for a way to soften the edges. Perhaps by creating an alphachannel with a slight blur as a mask for the green parts, but I'm worried that it would make the greencoloured parts leak into other colours.

I still haven't learned that much scripting, so I'm not quite sure how to check and translate this through code into Shake. I was playing around a bit and found that an easy way to create a simple version of the effect is to use reorder "ggba". This shows an approximate idea on what I am looking for, but is far from a good thing to use.

Could anyone steer me in the right direction? :magnify:

DavidW
May 29th, 2005, 03:31 PM
Hi there Nordh!
You could always go with the colorX node for that kind of problem. It's very flexible when you want to compare channels and do some logic at the same time. I attach a simple setup that does what you want but now it's only comparing the green and the red channel. You can quite easily alter the expression to you own custom needs.
Cheers!
// David

NorthernLights
May 29th, 2005, 08:22 PM
Thanks bro.

I added the b<g as well to the code:
r<g&&b<g?0:1

Works pretty ok. I enhanced green with a ColorX node using g+0.04, after that enhanced the RGD contrast to pull up all the colours so that they were easier to see and work with. Plus it looked a lot better in the end.

When looking at your attachment you can see what I mean with the leaking of the coloured area. I fixed this by using first a blur to smoothen the alhpachannel (I assume it's because of DV quality that the alhpachannel was so crispy after the ColorX node), but then I sharpened it back up a bit. This prevented most of the leaking.

And here's the result, brings back memories, doesn't it David? ;)