0

Is there any way to generate a 16-bits per channel(RGBA) PNG file using D3DX11SaveTextureToFile? Or any version of DirectX, any image library(C++), any image format

I tried to use the sample code here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb205131(v=vs.85).aspx

and modified the function names to D3D11 version.

The program works perfectly when I set the desc.Format to DXGI_FORMAT_R8G8B8A8_UNORM .

But the D3DX11SaveTextureToFile returns E_FAIL when I changed the desc.Format to DXGI_FORMAT_R16G16B16A16_UNORM .

I've tried to use DevIL (developer's image library) but it doesn't support 16-bits per channel png file.

1 Answers1

0

The only format which can save all texture-formats is D3DX11_IFF_DDS. It seems that D3DX11SaveTextureToFile can't save 16Bit pngs. One possibility is to extract the imagedata of your texture and save it manually with one of the possibilities (e.g. OpenCV or libpng) discussed here: Writing 16 bit uncompressed image using OpenCV.

Community
  • 1
  • 1
Gnietschow
  • 3,070
  • 1
  • 18
  • 28