How to save an R16 texture to a file?

I’m trying to save a Kinect/Kinect2 depth texture to a file in a lossless format where it can be read back in and used just like the output of the Depth node. Nothing I have tried so far works.

Is there some way to save a monochrome 16 bit texture to a file that preserves the full 16 bits? The DX9 Writer appears to scale it into 8 bits, losing resolution, and the DX11 Writer appears to just take the low 8 bits or does some kind of normalization, changing the brightness which screws up the depth.

Thanks!

have you tried with the .dds format? i’d assume that would save the bits straight.

1 Like

have done exactly that with dds before

I’d love to know if there was some lossless video codec which could do the same. (Is lossless really lossless?)

Ha, apparently they call it ‘deep colour’ :)

http://avisynth.nl/index.php/High_bit-depth_Support_with_Avisynth

this looks interesting re: 16 bit video. http://diracvideo.org/

Sorry for derailing your thread md!

@joreg - yup, just did and it Info does look correct, thanks! I’ll mark this as answered as soon as I verifyy by running it though my pointcloud shader.

But it does look like a bug that the DX9 and DX11 texture writers save out different files, I’ll post a test case and examples. And I just noticed the DX11 Info gives a red enumeration IOBox on the texture format… seems like I’ve seen that elsewhere.

@mrboni - no problemo, I would like that as well! It looks like the Y416 format would work: http://msdn.microsoft.com/en-us/library/windows/desktop/bb970578%28v=vs.85%29.aspx but no idea what supports it. I have not researched this before, but something like that must exist for film/video production.

@mrboni - found a discussion here: https://groups.google.com/forum/#!topic/microsoft.public.win32.programmer.directx.video/-PooAA_3sOY with a link to a converter filter. I am not fluent with DirectX filters, so not sure how to use this info…