Skip to main content

Kriptomatte_icon.png

Kriptomatte: Making Cryptomattes Easier for 2D Artists

This document outlines the Kriptomatte project, which aims to bring Cryptomatte functionality to Krita, the popular open-source painting software.

中文

What is Kriptomatte and What is this repo?

Kriptomatte is a tool that helps artists work with Cryptomattes, which are special masks embedded within EXR image files. These masks isolate objects, materials, and assets, making them easier to select and manipulate in video post-processing software.

Unfortunately, typical 2D image editing software doesn't work well with Cryptomattes, so artists often rely on ID Passes. While many popular software packages, such as Blender, lack the option to render ID passes, the codes in this repo (Kriptomatte Phase 1) offer a solution. Kriptomatte converts Cryptomatte information into ID Pass-like masks that can be used in painting software like Krita, Photoshop, and Clip Studio.

Kriptomatte Sample.png

Seperated Masks are also exported for a finer control.

Kriptomatte_Seperate_Mask.png

Project Phases

The Kriptomatte project is planned for four phases:

Phase 1: Python Script (Current Phase)

https://pypi.org/project/kriptomatte/

This phase focuses on creating a Python script that can extract Cryptomatte information from EXR files and convert it into separate, colored PNG images with alpha channels. This makes Cryptomattes more accessible to artists who can use these PNGs for painting in any software they prefer.

Phase 2: Standalone Executable

Phase 2 will rewrite the Python script in C++ to create a faster, standalone executable program. This program won't require any command-line experience; artists can simply drag and drop their EXR files onto the executable to generate the PNGs.

Phase 3a & 3b: Krita Integration

The final phases involve integrating Kriptomatte functionality directly into Krita. Phase 3a will focus on creating a C++ port of the code, while Phase 3b will develop a Python plugin for Krita.

Usage

Installation

You can install the script using pip from your command prompt (also known as a terminal). If you're unfamiliar with the concept, think of it as a special window where you type commands for your computer to execute. Here's how to open it on Windows: hold Shift and right-click on your desktop, then select "Open PowerShell here" or "Open Windows Terminal here." Once the terminal opens, copy and paste one of the following commands to install:

python -m pip install kriptomatte
# or
pip install kriptomatte

Use from Terminal

After installation, you can use the script in your terminal. Open the terminal again, navigate to the directory containing your EXR file, and run the following command, replacing "path/to/your/file.exr" with the actual path to your file:

To easily find the path to your EXR file on Windows, left-click it, then type alt + 3. This will copy the file location to your clipboard. You can then paste it into the command. If the hotkey doesn't work, you can find a light blue option to copy the file path in the top-left corner of your File Explorer.

kriptomatte -i "path to your exr file"
# for example
kriptomatte  -i "C:\Users\GrandArth\Pictures\sample.exr"

Important Note:

Currently, the script only supports Cryptomattes stored in 32-bit EXR files. Ensure your EXR files are rendered with 32-bit precision for the script to work correctly.

Code Reference

Friedman, Jonah, and Andrew C. Jones. 2015. “Fully Automatic ID Mattes with Support for Motion Blur and Transparency.” In ACM SIGGRAPH 2015 Posters, 1–1. Los Angeles California: ACM. https://doi.org/10.1145/2787626.2787629.
“OpenEXR Bindings for Python.” n.d. Accessed July 17, 2024. https://www.excamera.com/sphinx/articles-openexr.html.
“Psyop/Cryptomatte.” (2015) 2024. Python. Psyop. https://github.com/Psyop/Cryptomatte.
“Synthesis-AI-Dev/Exr-Info: Package with Helper Modules to Process EXR Files Generated by Renders.” n.d. Accessed July 21, 2024. https://github.com/Synthesis-AI-Dev/exr-info.

Metadata

Release files for kriptomatte 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kriptomatte 0.0.14
File Size Uploaded
kriptomatte-0.0.14.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for kriptomatte 0.0.14
File Interpreter ABI Platform
kriptomatte-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / kriptomatte-0.0.14.tar.gz

Download URL kriptomatte-0.0.14.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
f2df868e00e7b57f8e9054691eb58baf9ddd5d1765d6457eb7b1874b1cec69d4
BLAKE2b-256 checksum
How to use checksums
bcf63fd408db88b81b11a03507706c1f6d7303e5c2db1527eee95151265a542a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / kriptomatte-0.0.14-py3-none-any.whl

Download URL kriptomatte-0.0.14-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61cfcca9bc729bb555f3a75b4d1884fd0de215931fe5a002dc61936fc489688d
BLAKE2b-256 checksum
How to use checksums
23dd925d4efef1ebfddacd42296b8a584fbf4a0c9008aa68835868731f3c2911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page