Open mkitti opened 9 months ago
https://github.com/tlnagy/TiffImages.jl/blob/46131077adba3a7461288f1ebc67ceb89ea94ff4/src/utils.jl#L161 the encoding does exist in this package, so what went wrong?
I guess the actual problem here was
ERROR: MethodError: no method matching interpretation(::Val{TiffImages.PHOTOMETRIC_MINISWHITE})
I had never implemented PHOTOMETRIC_MINISWHITE as the Colors.jl
ecosystem doesn't have a nice way to represent inverted grayscales and I decided that ignoring the inversion (which is what most libraries do) is in violation of Colors.jl
's promise to represent the meaning of colors faithfully despite what the raw data might look like.
Presumably mappedarrays(complement, A)
would solve that problem?
I think we might also need setindex!
support as well.
xref: https://discourse.julialang.org/t/problem-in-reading-tiff-floats-file/106610/4
The primary problem is that
interpretation(::Val{TiffImages.PHOTOMETRIC_MINISWHITE})
is not implemented.TIFFTAG_SAMPLEFORMAT
value 3 corresponds toSAMPLEFORMAT_IEEEFP
. That is IEEE floating point.https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tiff.h#L335
If
TIFFTAG_BITSPERSAMPLE
is 32, then the image should be interpreted as consisting ofFloat32
samples.See the xref on Discourse for a TIF sample.