0
$\begingroup$

I am trying to create a precise black and white mask for objects rendered with Cycles. The background is transparent. The standard alpha mask creates semi-transparent pixels. I would like to create a mask, which covers all non-transparent and all semi-transparent pixels.

I tried to work with a color ramp but this does not lead to an acceptable result (see below -- note the edges), probably because the semi-transparent pixels are not covered completely.

Image Black and white mask

The blend file with my current compositor settings can be downloaded here.

Is there a better way to create a pure black and white mask?

Edit: Cryptomatte also does not create pure black and white masks.

Mask created with cryptomatte

$\endgroup$
9
  • 1
    $\begingroup$ Try Criptomatte functions. $\endgroup$ Commented Apr 19, 2021 at 10:42
  • 1
    $\begingroup$ I'm not sure why you want to achieve pure black and white masks... as long as the objects in your render not consist of only straight vertical and horizontal outlines, there will always be anti-aliasing on the diagonal and curved lines... and antialiasing on a transparent background means semitransparent pixels. If you don't want that, you'll maybe get ugly artifacts like you have with the color ramp. So what's your goal exactly? Another way to get pure black and white would be to use the Depth socket, plug it into a Normalize node, then into a Math node set to Less Than 1. $\endgroup$ Commented Apr 19, 2021 at 12:59
  • $\begingroup$ i think - i don't know - but i think he wants everything white which is not black and not alpphe = 0 $\endgroup$
    – Chris
    Commented Apr 19, 2021 at 13:14
  • 1
    $\begingroup$ Yeah, but looking at his remark "I tried to work with a color ramp but this does not lead to an acceptable result (see below -- note the edges)" makes me think he wants smoother edges. But they will never be as smooth as the anti-aliased ones. $\endgroup$ Commented Apr 19, 2021 at 13:19
  • $\begingroup$ maybe he doesn't know. I learned this right now from you too ;) $\endgroup$
    – Chris
    Commented Apr 19, 2021 at 13:28

0

You must log in to answer this question.

Browse other questions tagged .