Decode Cryptomattes in EXR file to PNG masks.
Project description
Kriptomatte Phase 1
The goal of Kriptomatte project is to provide Krita the opensource painting software with the ability to deal wth Cryptomattes in EXR images, thus the name Kriptomatte.
Planing
The Kriptomatte project will be carried in 4 separate phases.
Phase 1
Develop a Python script that, given an EXR file, can output combined and separated cryptomattes (which means ID masks for Objects, Materials and Assets) in common image format that supports Alpha channel, namely PNG.
In this phase, my aim is to make Cryptomattes more accessible for 2D artists in general. With a simple pip install kriptomatte
, artists can decode properly colored PNGs from EXR render results for painting in their favorite software, whatever it is.
Phase 2
After Phase 1 go through testing and finalizing, I will rewrite codes in Phase 1 in C++. So that a single drag and drop executable can be built. The executable will be doing the exact same thing, only faster. The tool will also be more accessible, as artists won't need to have any experience with pip
or any terminal
in general.
Phase 3a and 3b
Port the C++ code to Krita. Make a Python plugin for Krita.
Upon initial inspection, I believe after Phase 2, implementation in Krita should be simple (Push the results to layers with whatever code that dose the thing.). That being said, I have no experience with QT, so I plan to do these in the last Phase. Meanwhile, I do hope ppl have more experience with Python plugin can help bring the Phase 1 code to krita real soon.
Usage
python kripto_decode.py -i "path_2_exr_file"
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kriptomatte-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9544a56fa1d30da67288a7a893ef1a71397847b350a2532237d91cba9dc4b668 |
|
MD5 | e30715d114f515d150ee1a01067a099a |
|
BLAKE2b-256 | d87e54e3fd56c1156ccc1eedcff5856888833bfcf4a4f4339833e92a77ad5e6d |