The easy part is to load the cryptomatte file, traverse pixel by pixel, look at 
the values, and set a color for each pixel in the output image.

The hard part, if you really want to do it nicely, is probably to come up with 
the right color palette. I'm sure you don't just want to hash to any value in 
[0-1]^3. You probably don't want any electric neon colors that will give you a 
headache to look at, nor a bunch of darks that aren't easily distinguishable 
(probably black is for "nothing", and you wouldn't want an object color to 
accidentally be too close to it), and want the objects to be easily discernable 
from each other. So I imagine that the particular choice of what color space 
subset to use and how to spread the object ID colors within that space makes a 
big difference between a mishmash and a useful, pleasing visualization of the 
objects.


> On Mar 29, 2022, at 12:58 AM, Fabian Geisler 
> <fabian.geis...@automatik-vfx.com> wrote:
> 
> Hi Larry!
> 
> Thanks for the reply! :) We found an easy solution to this. You can save 
> previews in cryptomattes from almost any renderer that supports them. They 
> are turned off by default, since they do not contain any relevant data and 
> are therefore considered "deadweight". So all we did was turn the previews 
> back on and use the RGB channels as usual. That said, I am intrigued to try 
> your solution just for fun and exercise. Thanks for your help!
> 
> Cheers,
> Fabian
> 
> Sorry for the delay, sometimes things get away from me.
> 
> I don't think we have any built-in functionality for this, but I assume it 
> would be relatively straightforward -- I suppose all you're doing is reading 
> in the cryptomatte image and generating a new image where colors are randomly 
> (that is, hashed) assigned to each value of the data you're interested in 
> (object ID, namespace ID, material ID).
> 
> > On Feb 21, 2022, at 1:22 AM, Fabian Geisler 
> > <fabian.geis...@automatik-vfx.com 
> > <mailto:fabian.geis...@automatik-vfx.com>> wrote:
> >
> > Hi everyone!
> > I was wondering if it is possible to generate a preview image of 
> > cryptomatte files with oiio? Something like you can see here in the Nuke 
> > viewer 
> > <https://github.com/Psyop/Cryptomatte/blob/master/docs/nuke.md#nuke-usage 
> > <https://github.com/Psyop/Cryptomatte/blob/master/docs/nuke.md#nuke-usage>> 
> > would be great!
> > I think I read somewhere that it is not possible, since cryptomatte mainly 
> > consists of data that needs to be interpreted in a certain way.
> > Hope that someone can give me a definite yes or no. :)
> >
> > Cheers,
> >
> > --
> > Fabian Geisler
> > Pipeline TD
> >
> > Automatik VFX GmbH
> > www.automatik-vfx.com <http://www.automatik-vfx.com/> 
> > <http://www.automatik-vfx.com/ <http://www.automatik-vfx.com/>>
> > Schlesische Str. 38
> > 10997 Berlin
> > _______________________________________________
> > Oiio-dev mailing list
> > Oiio-dev@lists.openimageio.org
>  <mailto:Oiio-dev@lists.openimageio.org>> 
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org 
> <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
> 
> --
> Larry Gritz
> l...@larrygritz.com <mailto:l...@larrygritz.com>
> 
> -- 
> Fabian Geisler
> Pipeline TD
> 
> Automatik VFX GmbH
> www.automatik-vfx.com <http://www.automatik-vfx.com/>
> Schlesische Str. 38
> 10997 Berlin
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
l...@larrygritz.com




_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to