Home · Lab · CG Multipass & Relighting

CG2 Isolate with Cryptomatte

Pick the visor in the right layer and push it 1 stop, touching nothing else

CG Multipass & Relighting · ~7 min · Free

1 The idea

Cryptomatte stores several IDs in each pixel, each with how much of that pixel it covers, so the matte comes out anti-aliased. An ID pass with one ID per pixel can only answer yes or no. The visor is about 129 pixels, and 47% of the pixels it touches are partly covered edges.

Click the robot or the head zoom to pick an ID, then switch the matte source between “ID pass (1 ID per pixel)”, “Crypto: material” and “Crypto: object”. Show “matte (red)” to see the matte, and watch two readouts: the matte vs the visor’s coverage (an error weighted by brightness), and the antenna tips in the matte.

matte = Σ coverage where ID = pick (over the ranks)

2 Hands-on

Task: make the visor exactly 1 stop brighter and touch nothing else, not even the antenna tips that share the visor’s material.

Pick the visor with each matte source in turn and watch the two readouts: the matte vs the visor’s coverage (brightness-weighted), and the antenna tips in the matte. Both need to be close to zero. Check the edge in the zoom too.

SkyVFX Lab · CG2interactive · 1001

3 Deep dive

What one pixel holds

A pixel on the visor edge holds a mix of the visor and whatever sits next to it. Cryptomatte keeps a ranked list of IDs, each paired with the coverage it has in that pixel. The matte for a pick is the sum of the coverage wherever the ID matches, so edges and motion blur stay soft.

An ID pass with one ID per pixel gives the whole pixel to a single ID, so the edge becomes stair steps. In the figure, that matte misses the visor edge by up to about 61% (a brightness-weighted error).

One-ID-per-pixel passCryptomatte
Stored per pixelOne IDSeveral IDs with coverage
EdgeStair stepsAnti-aliased
Motion blurHard, yes or noSoft, follows coverage

Object, material or asset

Blender writes Cryptomatte as separate object, material and asset layers, each with a manifest of names. The same click in a different layer gives a different matte.

In the material layer, every part that shares a material is one pick: handy when the whole material should change. When the brief is one part, like the visor without the antenna tips, pick in the object layer. The asset layer groups larger pieces, depending on how the scene was set up.

Before you click, ask whether the brief is about a part or a material, then choose the layer.

Picks are names, not colours

Your picks are stored as names from the manifest. Copy the setup to another shot where the rig or namespace prefix differs and none of the names may match: the matte goes empty and no error appears.

The fix is to read the new shot’s manifest and remap each name by its last part, then look at every matte. A match on the last part can grab more objects than before, and some names may truly not exist in the new shot.

  1. 1Copy setup
  2. 2Read new manifest
  3. 3Remap by last part
  4. 4Check each matte

Where Cryptomatte runs out

Use a Cryptomatte as a stencil to put something new behind, and a blurred or defocused edge still shows the old colour, because the edge pixel’s colour is a mix. Edge-extend or paint the foreground colour out to the edge first, then mask by the same alpha.

Cryptomatte is good for quick picks of solid objects. Hair, fur, volumes and heavy overlapping blur are better done with deep. ID and crypto layers are data: read them raw, never through a colour transform.

If a blurred edge still shows the old colour, don’t blame the matte; look at the edge pixel’s colour.

4 In real work

In Nuke

  1. Read the EXR with the ID and crypto layers kept raw, not run through a colour transform.
  2. Cryptomatte: set Layer Selection to the object layer and pick the visor; the picked names land in the Matte List.
  3. EXPTool in Stops at +1 (which is ×2), or a Grade with gain 2, with the matte plugged into the mask.
  4. Or use Keymix: graded image into A, original into B, matte into mask. With no mask, Keymix outputs B.
  5. Shuffle2 to move the matte into the channel you need, and Merge2 when the matte is used as a stencil.

Common mistakes → the fix

  • ✗ Picking in the material layer when only one object should change✓ Pick in the object layer and check that parts sharing the material stay untouched.
  • ✗ Using a one-ID-per-pixel pass and getting stair-step edges✓ Use Cryptomatte, which stores coverage, for an anti-aliased edge.
  • ✗ Copying a comp to another shot without checking the names still exist✓ Compare the matteList names with the new shot’s manifest, remap, and look at each matte.
  • ✗ Grading under a crypto stencil on a blurred edge and seeing the old colour in the fringe✓ Edge-extend or paint the foreground colour to the edge, then mask by the same alpha.
  • ✗ Reading the ID or crypto layers through a colour transform✓ Read them raw: they are data, not pictures.

Before you send the shot

  • The matte comes from the layer that fits the brief (part or material).
  • Parts that share the material but aren’t in the brief are unchanged.
  • Zoomed in, the edge shows no stair steps.
  • Every matteList name exists in this shot’s manifest and no matte is empty.
  • No old colour shows in blurred edges.
  • The ID and crypto layers are read raw.

5 Check yourself

One question to check yourself

You pick the visor and raise the exposure, but the antenna tips brighten too. Why?

What you learned

🔒 Answer the question above and this card opens

More questions

1. In a comp copied from another shot, the Cryptomatte matte is empty but there’s no error. What’s the most likely cause?

2. Why does a Cryptomatte matte have a soft edge while an object ID pass gives stair steps?

Where the numbers come from: Every picture is a Blender 5.2 Cycles render of our own desert and robot (tools/assets/passes_cg.py), computed in your browser. The coverage is Blender’s real Cryptomatte (object and material layers, 3 ranks shipped). The IDs are renumbered to small integers so they fit float16; the names come from Blender’s manifest. The one-ID-per-pixel matte is built from rank 0 only, to show what an aliased ID pass does. The decode is a teaching version, the same idea as Nuke’s Cryptomatte node.