Psyop / Cryptomatte

Cryptomatte Nuke plugin, Fusion plugin, sample images, and specification
BSD 3-Clause "New" or "Revised" License
634 stars 151 forks source link

Cryptomatte not working with DWA compression #35

Open sharktacos opened 7 years ago

sharktacos commented 7 years ago

Cryptomatte works fine on a multichannel EXR with ZIP scanline compression, but not with DWAA or DWAB compression. That is, it is not possible to select the objects in Nuke with the Cryptomatte gizmo when the image is rendered with DWA compression. Experiencing this both with Arnold and Vray renders.

anderslanglands commented 7 years ago

DWA compression is lossy. Cryptomatte relies on exact values in the images, so lossy compression will break it. On Thu, 21 Sep 2017 at 15:19, sharktacos notifications@github.com wrote:

Cryptomatte works fine on a multichannel EXR with ZIP scanline compression, but not with DWAA or DWAB compression. That is, it is not possible to select the objects in Nuke with the Cryptomatte gizmo when the image is rendered with DWA compression. Experiencing this both with Arnold and Vray renders.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Psyop/Cryptomatte/issues/35, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2IXaQ3cJHRGo4-PsuroqvkhGIJrVbbks5skdW1gaJpZM4Pev0Q .

dekekincaid commented 7 years ago

DWA is only lossy on channels named: R, G, B, RY, BY, Y (case sensitive). All other channel names are treated as lossless.

anderslanglands commented 7 years ago

Yeah was just reading the source code. Yay for magic constants. So... everyone has to change to outputting .xyz instead of .rgb now? On Thu, 21 Sep 2017 at 15:44, Deke Kincaid notifications@github.com wrote:

DWA is only lossy on channels named: R, G, B, RY, BY, Y (case sensitive). All other channel names are treated as lossless.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Psyop/Cryptomatte/issues/35#issuecomment-331042950, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2IXdcg-jF2X0XtFQlfRG4zIqqwlocJks5skdu5gaJpZM4Pev0Q .

sharktacos commented 7 years ago

x y z should work, just be careful of Y (capitol Y is lossy). I believe if they were named r g b (lowercase) that would work too. They just can't be named R G B (capitol letters).

anderslanglands commented 7 years ago

rgb gets lossy compression as well. Full list is here in function initializeDefaultChannelRules(): https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfDwaCompressor.cpp

Would be nice if they'd allowed for customising it via header metadata or something rather than just hard-coding it... On Thu, 21 Sep 2017 at 18:18, sharktacos notifications@github.com wrote:

x y z should work, just be careful of Y (capitol Y is lossy). I believe if they were named r g b (lowercase) that would work too. They just can't be named R G B (capitol letters).

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Psyop/Cryptomatte/issues/35#issuecomment-331062268, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2IXVJoTtCjjdvHXvldi0WmyFOxr2gPks5skf-ugaJpZM4Pev0Q .

vkoylazov commented 7 years ago

This will be fixed in a V-Ray nightly soon. To fix it we patched the OpenEXR2 library to allow us to explicitly specify if a channel should be DWA compressed.

Best regards, Vlado


From: Anders Langlands notifications@github.com Sent: Thursday, September 21, 2017 9:21:10 AM To: Psyop/Cryptomatte Cc: Subscribed Subject: Re: [Psyop/Cryptomatte] Cryptomatte not working with DWA compression (#35)

rgb gets lossy compression as well. Full list is here in function initializeDefaultChannelRules(): https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfDwaCompressor.cpp

Would be nice if they'd allowed for customising it via header metadata or something rather than just hard-coding it... On Thu, 21 Sep 2017 at 18:18, sharktacos notifications@github.com wrote:

x y z should work, just be careful of Y (capitol Y is lossy). I believe if they were named r g b (lowercase) that would work too. They just can't be named R G B (capitol letters).

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Psyop/Cryptomatte/issues/35#issuecomment-331062268, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2IXVJoTtCjjdvHXvldi0WmyFOxr2gPks5skf-ugaJpZM4Pev0Q .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Psyop/Cryptomatte/issues/35#issuecomment-331062737, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABgLWi04WWpEfPoA-pT5OPyCxrljzDQUks5skgBWgaJpZM4Pev0Q.

jonahfriedman commented 7 years ago

@vkoylazov Very cool. Are you compressing the coverages? Roughly what kind of file size improvements are you seeing with DWA Cryptomattes?

jonahfriedman commented 7 years ago

Another observation: While you are required to have the same compression for the whole file, you are allowed to have different data types per channel (EXR technical introduction, page 7), and having the coverages at half I think would always make sense, maybe even with lossy compression.

We'd have to test pretty carefully that images with RGBA set to different data types don't confuse the various applications, but that's another thing to try.

dekekincaid commented 7 years ago

rgb doesn’t get lossy. If you look at the source that is only for openexr 1.0 which was before dwa shipped to the public. 2.0 is only for capital RGBYGYRY.