# How does Cryptomatte work?

**URL:** <https://forums.chaos.com/t/how-does-cryptomatte-work/83756>\
**Category:** General\
**Created:** [July 6, 2017, 9:42am UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756 "2017-07-06T09:42:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgruwier](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/dgruwier/32/36951_2.png) [@dgruwier](https://forums.chaos.com/u/dgruwier)\
**Post date:** [July 6, 2017, 9:42am UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/1 "2017-07-06T09:42:18Z")

</div>

Not as in “how do I use it”, but “how does it work technically”?

Using something like Render ID also creates a shade of color per ID, but doesn’t support blending colors (aa, motion blur, dof), since you wouldn’t be able to accurately isolate the colors at the edges as they mix with each other. What does cryptomatte do to get around this? It’s still just an image file with RGB values right?

---

<div class="post-metadata">

**Author:** ![Moriah](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Moriah](https://forums.chaos.com/u/Moriah)\
**Post date:** [July 6, 2017, 11:34am UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/2 "2017-07-06T11:34:26Z")

</div>

I would like to know this too!

Also, how does someone import this in Fusion?

---

<div class="post-metadata">

**Author:** ![instinct](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/instinct/32/74489_2.png) [@instinct](https://forums.chaos.com/u/instinct)\
**Post date:** [July 6, 2017, 11:36am UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/3 "2017-07-06T11:36:49Z")

</div>

The poster outlines the technical basis: [https://github.com/Psyop/Cryptomatte/raw/master/specification/IDmattes\_poster.pdf](https://github.com/Psyop/Cryptomatte/raw/master/specification/IDmattes%5C_poster.pdf)

The repo also has fusion code: [GitHub - Psyop/Cryptomatte: Cryptomatte Nuke plugin, Fusion plugin, sample images, and specification · GitHub](https://github.com/Psyop/Cryptomatte)

---

<div class="post-metadata">

**Author:** ![Moriah](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Moriah](https://forums.chaos.com/u/Moriah)\
**Post date:** [July 6, 2017, 12:34pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/4 "2017-07-06T12:34:33Z")

</div>

@instinct i tried installing the fusion code but nothing appears on the tools (Fusion Free btw, but i think it supports it, since it’s not an OFX).

---

<div class="post-metadata">

**Author:** ![dgruwier](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/dgruwier/32/36951_2.png) [@dgruwier](https://forums.chaos.com/u/dgruwier)\
**Post date:** [July 6, 2017, 1:04pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/5 "2017-07-06T13:04:38Z")

</div>

@instinct That is perfect, exactly what I was looking for. Thank you!

---

<div class="post-metadata">

**Author:** ![instinct](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/instinct/32/74489_2.png) [@instinct](https://forums.chaos.com/u/instinct)\
**Post date:** [July 6, 2017, 2:55pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/6 "2017-07-06T14:55:19Z")

</div>

@Moriah : I am not using fusion myself so i cannot really help beyond pointing at the repository i am afraid ☹

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [July 6, 2017, 7:50pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/7 "2017-07-06T19:50:22Z")

</div>

I’ll see if we can add some guides in the docs to get things up and running in Nuke and in Fusion.

Best regards,  
Vlado

---

<div class="post-metadata">

**Author:** ![DENEB](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@DENEB](https://forums.chaos.com/u/DENEB)\
**Post date:** [July 7, 2017, 3:11pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/8 "2017-07-07T15:11:36Z")

</div>

@Moriah to use cryptomatte with V-Ray in Fusion

first render a scene with VRAY 3.6 with cryptomatte render element  
Important: you have to write the EXR from the V-Ray raw image in the framebuffer rollout in V-Ray tab in the render setup dialogbox, don’t try to save direct from the VFB that does not work.

1) install FUSION 8.x  
2) get the cryptomatte file on the GitHub  
3) copy  
- lmurmurhash3.lua  
- simplejson.lua  
- struct.lua  
to C:\Program Files\Blackmagic Design\Fusion 8  
4) copy  
- cryptomatte.fuse  
to C:\Program Files\Blackmagic Design\Fusion 8\Fuses  
5) Start Fusion  
6) create a loader and load your EXR, copy this loader to have two  
7) In the first loader right click and select insert tools / cryptomatte / cryxptomatte (this will change automatically the channel assignement of your loader, without that nothing is working )  
8 ) Assign the cryptomatte1 node/tile to one of the fusion viewport  
9) Then move the small red axis to the object you want to matte and click the Add button  
10) Your object is selected with correct AA  
11) Now add an effect to the second loader for exemple colorcorrect (rightclick - insert tools / color/ colorcorrector)  
12) Set some color correction for test in ColorCorrector1  
13) Then add the output of the cryptomatte to “ColorCorrector1.effect mask”  
14) Assign the ColorCorrector1 to one of the fusion viewport

You got it your object is color corrected with perfect AA

Now you can play with the Cryptomatte1 to add more object to your mask

Best regards  
PA

---

<div class="post-metadata">

**Author:** ![Moriah](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Moriah](https://forums.chaos.com/u/Moriah)\
**Post date:** [July 7, 2017, 4:06pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/9 "2017-07-07T16:06:38Z")

</div>

@DENEB im getting this error after copying the files you mentioned and launching Fusion 8. Any idea?

 ![Untitled-1.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/d/7/d7547aba601439e6d1f29d0a22b8aceb8c195a7c.jpeg)

---

<div class="post-metadata">

**Author:** ![gandhics](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@gandhics](https://forums.chaos.com/u/gandhics)\
**Post date:** [July 7, 2017, 6:38pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/10 "2017-07-07T18:38:24Z")

</div>

Download zip and unzip and install.  
If you save as from browser, browser add unneccesarystring.

---

<div class="post-metadata">

**Author:** ![Moriah](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Moriah](https://forums.chaos.com/u/Moriah)\
**Post date:** [July 7, 2017, 6:53pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/11 "2017-07-07T18:53:23Z")

</div>

That worked, thanks to both of you!

---

<div class="post-metadata">

**Author:** ![stevesideas](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/stevesideas/32/29103_2.png) [@stevesideas](https://forums.chaos.com/u/stevesideas)\
**Post date:** [July 7, 2017, 8:21pm UTC](https://forums.chaos.com/t/how-does-cryptomatte-work/83756/12 "2017-07-07T20:21:28Z")

</div>

Thanks for the tip on installing. I’ll be interested to see this working within Fusion. Could prove to be very very useful.
