- Published on
Unlocking Precision Compositing with Cryptomatte in Blender (Cycles, Blender 4.x)
- Authors
- Name
- Rodney Zamora
Cryptomatte is a powerful tool integrated into Blender that revolutionizes the process of creating mattes (selection masks) for compositing. It generates ID mattes automatically with incredible accuracy, even for objects with motion blur, transparency, or depth of field, which are traditionally challenging for ID passes. This guide explains how to enable, use, and benefit from Cryptomatte in Blender, primarily with the Cycles render engine.
What is Cryptomatte and Why Use It?
Traditional ID mattes often suffer from aliasing (jagged edges) and difficulty selecting objects accurately, especially in complex scenes. Cryptomatte solves this by storing multiple layers of selection information directly in the rendered image, using a set of unique IDs for objects, materials, or assets.
Advantages of Cryptomatte:
- High Accuracy: Generates clean, anti-aliased mattes, even with motion blur, depth of field, and transparency.
- Ease of Use: Simplifies the selection process in compositing; just pick what you want directly from the render.
- Flexibility: Allows selection based on objects, materials, or even parent assets.
- Industry Standard: Widely adopted in VFX pipelines.
How to Enable and Configure Cryptomatte Passes (Cycles)
Cryptomatte is primarily a feature of the Cycles render engine in Blender. Eevee does not offer direct Cryptomatte pass generation in the same way; for Eevee, you would typically rely on Object Index or Material Index passes for simpler ID mattes.
To enable Cryptomatte passes in Cycles for Blender 4.x and recent versions:
- Go to the View Layer Properties tab in the Properties panel.
- Expand the Passes > Cryptomatte section.
- Here, you can enable Cryptomatte passes for:
- Object: Generates mattes based on individual objects.
- Material: Generates mattes based on the materials assigned to objects.
- Asset: Generates mattes based on parent objects or assets (useful for complex hierarchies or linked assets).
- Levels: This setting determines the number of unique IDs stored per pixel (e.g., how many overlapping transparent objects can be uniquely identified). Higher levels mean more accuracy in complex situations but also larger file sizes. A level of 6 is often a good balance.
- Accurate Mode: This option can improve matte quality on sharp edges and with small features but may increase render time.
Once enabled, these passes will be rendered along with your beauty pass when you render your scene.
Using the Cryptomatte Node in Blender's Compositor
After rendering your scene with Cryptomatte passes enabled:
- Open Blender's Compositor.
- Ensure "Use Nodes" is checked. You should see a "Render Layers" node.
- Add the Cryptomatte node by pressing
Shift+A
and going to Matte > Cryptomatte. - Connect the
Image
output from your Render Layers node to theImage
input of the Cryptomatte node. - The Cryptomatte node itself has a dropdown menu where you can select which Cryptomatte pass to use (e.g.,
CryptoObject00
,CryptoMaterial00
). The corresponding data stream from the Render Layers node (likeCryptoObject00
,CryptoObject01
, etc.) will automatically be used. You typically don't need to manually connect these individualCrypto...
sockets unless you have a very specific custom setup. - Picking Mattes:
- In the Cryptomatte node's properties (visible in the N-panel or by selecting the node), you'll find an "Add" and "Remove" eyedropper tool.
- To select an object or material, click the "Add" eyedropper, then click on the desired object/material directly in the Viewer node (if you have one connected to the Cryptomatte node's "Pick" output) or in the Image Editor displaying your render result (if the compositor is active for it).
- You can add multiple selections. Use the "Remove" eyedropper to deselect items.
- Outputs: The Cryptomatte node has two main outputs:
Image
: This shows the original image with the selection overlaid (useful for previewing).Matte
: This is the crucial output. It provides a black and white alpha mask of your selection, which you can then use as a factor for color correction, effects, or combining layers.
OpenEXR Compatibility
Crucially, Cryptomatte data is embedded within the OpenEXR image format. When saving your renders, you must use an OpenEXR format (like OpenEXR MultiLayer) to retain the Cryptomatte information. Standard formats like PNG or JPEG will not store this data.
Using OpenEXR also means your Cryptomatte-enabled renders can be used in other compositing software that supports the Cryptomatte standard, such as Nuke, DaVinci Fusion, or After Effects (with appropriate plugins).
(This video provides a visual demonstration of setting up and using Cryptomatte in Blender.)
Related questions:
Q: What is Cryptomatte in Blender?
A: Cryptomatte is an advanced system in Blender (primarily for Cycles) that generates highly accurate ID mattes (selection masks) for objects, materials, or assets. These mattes are embedded in OpenEXR renders and can be easily used in compositing to isolate elements with precision, even with motion blur, transparency, and depth of field.
Q: How do you make/use a Cryptomatte in Blender?
A:
- Enable Passes: In Cycles, go to
View Layer Properties > Passes > Cryptomatte
and enable passes for Object, Material, and/or Asset. - Render: Render your scene and ensure you save it as an OpenEXR file.
- Compositor: Add a
Cryptomatte
node. Connect your Render Layer'sImage
output to it. - Select: Use the eyedropper tools within the Cryptomatte node to pick objects/materials directly from the render preview.
- Use Matte: The
Matte
output of the Cryptomatte node provides the alpha mask for your selection, ready for compositing operations.
Q: What are the advantages of Cryptomatte over traditional ID mattes?
A: Cryptomatte offers several key advantages:
- Anti-aliased Edges: Produces much cleaner, smoother edges than traditional object/material index passes.
- Handles Complexity: Works reliably with motion blur, depth of field, and transparency, where old ID mattes often fail.
- Ease of Selection: Allows direct picking from the rendered image in the compositor, rather than guessing ID numbers.
- Multiple Selections per Pixel: Can accurately isolate multiple overlapping transparent objects.