TIFF Encoder support saving grayscale using 16 bits (L16) #2333
-
We have a large grayscale image (1 gigapixels) of the L16 pixel format. Currently it appears the TIFF encoder does not support saving 16 bits per sample and 1 sample per pixel images. At the moment this setup is saved as 8 bits per sample and 3 samples per pixel. ImageSharp/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs Lines 54 to 59 in 03cc807 ImageSharp/src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs Lines 376 to 390 in 03cc807 This feature would allow us to properly save the image as grayscale and not use an extra 8-bits per pixel when using the following encoder settings. var image = new Image<L16>(4, 2);
image.SaveAsTiff("tmp.tiff", new TiffEncoder() { BitsPerPixel = TiffBitsPerPixel.Bit16, PhotometricInterpretation = TiffPhotometricInterpretation.BlackIsZero}); From doing a quick look through the code on GitHub, it should be fairly straightforward to implement this. I can give implementing this a shot if the team would like. Ideally it can go in both 2.1.X and v3. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ptasev It would be awesome if you could implement this, thanks! We wouldn't backport a feature into 2.1.x though only critical (i.e. security driven) defects. V3 is very close to completion and will be released hopefully within the next few weeks. |
Beta Was this translation helpful? Give feedback.
Hi @ptasev
It would be awesome if you could implement this, thanks!
We wouldn't backport a feature into 2.1.x though only critical (i.e. security driven) defects. V3 is very close to completion and will be released hopefully within the next few weeks.