You can see this thread : Can't seem to save a 32-bit grayscale tiff
System::Windows::Media::Imaging::TiffBitmapEncoder does not support Gray32Float Pixelformat
When using System::Windows::Media::Imaging::TiffBitmapEncoder, it seems that a Gray32Float on input will generate a Gray16 Pixelformat on output, thus losing information.
Is there a workaround ?
It tried to change the Compression property, without any success.
I have a minimal project to reproduce https://chachatelier.fr/tmp/TestWindowsMediaTIFF.zip
[edit]
I would not care if I could avoid reencoding such an image, but I need to edit metadata and I did not find any way to edit metadata in place without decoding first
1 additional answer
Sort by: Most helpful
-
Amin Dodin 1 Reputation point
2021-10-21T16:01:51.41+00:00 If you need to properly decode the 32-bit grayscale image without losing any of the gray shades, you can use the LEADTOOLS document imaging SDK. (Disclosure: I work for the SDK’s vendor).
You can also read and write TIFF tags and comments without decoding or re-encoding the image data itself. This is explained in the .NET tutorial Read and Write TIFF Tags and Comments
If you would like to try the LEADTOOLS classes, you can download the free evaluation from this page.