Cycles material ID antialiasing - turn it on

Hello.

I made a render of a table on a studio white background - simple enough, but I wanted to change the background itself in photoshop. I was going to use the material ID pass to isolate the item from the background, but the pixels along the edges of the item are set to either pure white or black.

The rendered image itself is antialiased and from what I’ve seen on the net separate “colour” passes are as well, but the ID mask still ends up being ridiculously jagged. Blurring the edges in photoshop does not fix the problem.

I suppose a workaround is possible, but let’s stay focused on antialiasing the mask within Blender, posibly at render-time. Any way to do that?

Thanks in advance.

Check out the newly added cryptomatte feature, it is exactly what you are looking for.

Just to be clear, no. Antialiasing wouldn’t produce a mask with clear separation. There’s no ID which is some % of the next mask, and no mixed color which keeps track of how much each color there is, which would be needed for producing anti-aliasing on a mask.

Suggested Cryptomatte can do that.