# Cycles compositor - apply color balance node only on a part of image

In compositor I want to apply color balance node only on a part of image for which I have a mask. I have issue with combining original image with modified part so that a colors aren't mixed together but they're replaced (in place of the mask) How can I achieve this effect?

Instead of combing the two results after you have colored corrected the one you could restrict the color correction to a specific region.

To do this feed the mask into the Fac Input of the Color Balance Node.

You can also use an image as a mask. Plug the image into the Fac Input of the Color Balance Node. Note that white means apply, black mean ignore. THis mean that the color balance will only be applied where the image is white. In my case I had to invert the colors to only apply the color balance on the scribble.

• Thanks! I don't know how but I quite forget to factor in color balance node. I was mixing original image with modified. I thought I could replace part of image with one of the blending type from color mix node.. But it seems that there's no "replace" blending type in color mix node – user2694295 Mar 2 '14 at 23:27
• @user2694295 You could do it that way if you used the Mix blend mode with a B/W mask as the mix factor. However it's better to use the factor on the color correction node. – gandalf3 Mar 3 '14 at 0:32
• @gandalf3 you could, but the method I posted is better because it limits the computation the desired area. No need to compute pixel that will get thrown out anyway. – Vader Mar 3 '14 at 0:36
• @Vader I agree 100%, but I thought I would add that mix can be used to "replace". – gandalf3 Mar 3 '14 at 0:38
• @gandalf3 okay. fair enough. – Vader Mar 3 '14 at 0:39

Vader's answer is better in this case, however it is possible to do this using the mix node by using the mask/black and white image as the mix factor: (click for full size)

This works because the mix factor is controlled per-pixel by the black and white mask.
White = mix factor of 1 and black = mix factor of 0. So the bottom input will be used where the mask is white and the top input will be used where the mask is black.