New issue 13 by rangoni....@googlemail.com: Does work for 1bit compressed
TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13
It seems that the library is working well for greyscale and color images,
but as soon as a pure black&white (1bit/1plan) is given, it fails and
renders a totally black image
I suppose there is something to do in read_image function cause I saw some
comments in the code saying "TODO: check for correctness"
I wrote a patch to read group4 binary images... it might not work for other
compression schemes, and gives an image with inverted colors.
Attachments:
pylibtiff.patch 513 bytes
It works for my images! Thanks for the patch!
Comment #3 on issue 13 by pearu.peterson: Does work for 1bit compressed TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13
Even if it does not provide complete support for 1bit images
(no write support, the returned array is actually 8 bit array
because numpy does not have int1 type available)
I have applied the patch (with slight modification) to svn repo
because the patch is simple and it works for some applications.
There is no int1 type available, but there is numpy.bool for binary
vectors...
Sure, but numpy.bool has 8 bits, not 1, and thus it is equivalent to
numpy.int8.
This makes writing numpy.bool arrays as 1 bit arrays tricky (need to use
bittools extension module to convert 8bit arrays to 1bit arrays before
calling WriteStrip).