Issue 13 in pylibtiff: Does work for 1bit compressed TIFF

7 views
Skip to first unread message

pyli...@googlecode.com

unread,
Mar 11, 2011, 11:07:54 AM3/11/11
to pylibtif...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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"

pyli...@googlecode.com

unread,
Nov 5, 2011, 8:34:15 PM11/5/11
to pylibtif...@googlegroups.com

Comment #1 on issue 13 by vcha...@gmail.com: Does work for 1bit compressed
TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13

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

pyli...@googlecode.com

unread,
Nov 6, 2011, 11:55:52 AM11/6/11
to pylibtif...@googlegroups.com

Comment #2 on issue 13 by rangoni....@gmail.com: Does work for 1bit
compressed TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13

It works for my images! Thanks for the patch!

pyli...@googlecode.com

unread,
Nov 6, 2011, 3:47:49 PM11/6/11
to pylibtif...@googlegroups.com
Updates:
Status: Fixed

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.

pyli...@googlecode.com

unread,
Nov 6, 2011, 4:03:44 PM11/6/11
to pylibtif...@googlegroups.com

Comment #4 on issue 13 by vcha...@gmail.com: Does work for 1bit compressed
TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13

There is no int1 type available, but there is numpy.bool for binary
vectors...

pyli...@googlecode.com

unread,
Nov 6, 2011, 4:25:52 PM11/6/11
to pylibtif...@googlegroups.com

Comment #5 on issue 13 by pearu.peterson: Does work for 1bit compressed TIFF
http://code.google.com/p/pylibtiff/issues/detail?id=13

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).

Reply all
Reply to author
Forward
0 new messages