I’m trying to write a 16bit or higher texture to disk using Stride in vvvv.
First, I rendered the fullscreenquad into a rendertexture. Then I used the textureWriter node to write to disk. However, it seems only 8 bit formats are supported there as I get the pink box outline.
Then I thought to try to pipe it into OpenCV. I convert the Texture using TextureToImage, then using that output in OpenCV’s FromImage input. That also doesn’t seem to like 16 or 32bit formats that the RenderTexture likes. Strange as I use opencv for 32bit all the time in python.
Finally, I see I can get the array of RGBA using ReadBackTexture, but I’m not clear on what steps to do after as it seems I have to create my own writer. Any help is appreciated!
had a quick look in the code and it seems that we have a check for 8 bits per pixel formats, which is too restrictive because you can save high bit depth textures in DDS format. Sorry for that, it will be fixed in upcoming previews.
Meanwhile, reference this doc on your project doc and use the TextureWriterTemp and use DDS as file format, it allows to save 16 and 32 bit textures. TextureWriterTemp.vl (22.8 KB)
The DDS files will be uncompressed, they will only be compressed if you apply dxt compression. In my quick test, I’ve only tried DDS.
Unfortunately 16-bit png isn’t supported by the stride texture writer, I believe. If you need that, you might have to add another conversation step into your toolchain to compress the raw pixel data in the DDS to PNG.
But you can also try tiff and bmp, maybe they will also accept texture formats with higher bit depths.
The texture writer in the patch above still got all options, it just doesn’t apply any restrictions, but might throw an error if an unsupported combination of pixel format and file type is selected.