2
$\begingroup$

I tested masking in the Blender compositor.
Please see the GIF below.
The 1st to 3rd outputs are Crptomattes(obj, mat, asset) and the 4th to 5th outputs are ID Masks(obj, mat). All mattes have border artifacts on the edges of those things.
enter image description here


The following shows border artifacts not only in black but also in normal color correction.
enter image description here


What did I miss?
How to use Cryptomatte or ID Mask correctly without border artifacts in Blender compositor?

I've attached a blend file to help you write your answer.

$\endgroup$
  • 1
    $\begingroup$ In Fusion guys did some macro to avoid this. Would like to if someone can do similar in blender blenderartists.org/t/cryptomate-matte-edge-imperfection/1189344/… $\endgroup$ – vklidu Jan 23 '20 at 9:20
  • $\begingroup$ The resolution is really low, what nodes are you using for the compositing? $\endgroup$ – Robert Gützkow Jan 23 '20 at 18:18
  • $\begingroup$ @RobertGützkow I used an Alpha Over node and found this problem at 2560x1440 resolution. The image attached to the question was created in a small size just to capture the GIF. I've written a new Cryptomatte question that adds a resolution perspective. Please check. $\endgroup$ – J. SungHoon Jan 24 '20 at 7:19
1
$\begingroup$

Good news! This has been solved. Our friends at CG Cookie actually made a video in 2013 (before Cryptomatte) that explains the problem and a solution we have when working with a flattened scene: Working with Alpha Edges for Compositing in Blender. No matter how perfect the matte is, even Cryptomatte cannot solve the subject / background color mixing on the edges. However, the video shows how to use nodes in Blender to get around this! Essentially, you duplicate and invert the matte and apply it to the background, and use Inpaint node on both the foreground and the background to simulate and extend edges of unmixed color. Here is a basic node setup. Note that the ColorRamp nodes each have a black stop and a white stop, they're just VERY close together but they don’t necessarily have to be if your edges look clean: enter image description here The techniques work great with Cryptomatte, and solved my edge issues very well. In fact, I believe their Blender compositor approach is the same basic principle used in the Fusion solution linked in comments above. Knowing this approach, it's also useful for working with other types of flat footage that requires mattes and decontaminating the edges of color blend from subject to background.

Another solution would be to use separate render layers via linked scenes and collections, then composite those, but that is not always practical or possible. It would be amazing to have an automated way to render separate layers based upon the Cryptomatte (would probably only work at object level, not material level), or maybe get some kind of deep compositing method like this video shows: Skill Up With Nuke | An Introduction To Deep Compositing In 11.2. Eevee and Cycles do not have deep compositing at the moment, but perhaps another render engine compatible with Blender does have it.

$\endgroup$
  • $\begingroup$ Hi! Link-only answers are discouraged. If the link of "our friends" goes down so does the answer. This is not a regular forum, it's a Q&A site so please include all relevant steps into this answer. Consider that eevee and cycles can't render deep so your last paragraph won't really help... Also watching a 15min video to resolve possible artefacts is a real waste of time IMHO. $\endgroup$ – brockmann Apr 7 '20 at 6:49

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.