2
$\begingroup$

I have an image that is mostly values between .3 and 1, but has a few areas of solid black. I want to set all the pure black areas (or perhaps near black to also catch aliased edges) to be the next lowest value instead.

This is possible with color ramps on a per image basis, but I need a setup that will work across multiple frames where the specific values could change quite a lot (in one frame it may be .3, then the next .5, etc.)

It seems like the way to accomplish this would be to create a mask of the dark areas, and then have a node group that mixes that area with the second lowest value. For this to work, I need some way to get the lowest value in an image, and a way to ignore certain areas.

Is this possible? Or any other ways to solve this issue?

$\endgroup$
2
$\begingroup$

This node setup is mostly what HenrikD proposed:

black mask node setup

It takes an image input and tests for pixels whose R, G, and B values are all less than a user-specified value (in this screenshot, it was .0005, which appears as .001 in the entry box). Those pixels can then be replaced by any user-specified color, I'm using red here to show the affected pixels but you would instead substitute your almost-black color.

Output with limit value of .01:

Output with limit value of .01

Output with limit value of .03:

Output with limit value of .03

If it is necessary to actually calculate the almost-black color from the image itself . . . I'm not offhand sure how to do that, sorry.

$\endgroup$
0
$\begingroup$

I think you can do this using math nodes, just use "less than" with a very small value (ex. 0.001) and use the result as your mask, i don't know it that's what you asked for, but I hope this can help you :)

$\endgroup$
0
$\begingroup$

I would use the Math Node with Maximum selected. To use that it would be necessary to seperate RGB channels and combine them after that. I guess you could also try to Add your second darkest color with the MixRGB Node, if that would fit your application. The Color Balance Node would work even better then, but is more difficult to work with.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.