yigolden / TiffLibrary

C# library for decoding and encoding Tag Image File Format (TIFF) files.
MIT License
58 stars 16 forks source link

Black is zero #17

Open hhubschle opened 1 year ago

hhubschle commented 1 year ago

Fixes a problem where 16 bit gray images are not saved correctly; only 8 bit was supported. Changed BlackIsZero8Encoder to BlackIsZeroEncoder and infer BytePerSample and BitsPerSample from the type. Also add some unit tests that failed previously.

hhubschle commented 1 year ago

If appears that YCbCr888Testsproduces random failures. Probably because TiffYCbCrConverter8 introduces some errors for certain RGB values.

I can reproduce the failure reliably by setting the number of pixels to 100000. image