Issue 14 in pylibtiff: TIFFimage and RGB

10 views
Skip to first unread message

pyli...@googlecode.com

unread,
Aug 23, 2011, 6:29:01 AM8/23/11
to pylibtif...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 14 by tre...@gmail.com: TIFFimage and RGB
http://code.google.com/p/pylibtiff/issues/detail?id=14

is it possible to write RGB tiff files by means of python module ?

i can only obtain a GRAY file with width multiplied by 3.

i quickly read sources and i don't understand how to set photometric and
samplesperpixel tags.

pyli...@googlecode.com

unread,
Aug 23, 2011, 7:01:23 AM8/23/11
to pylibtif...@googlegroups.com
Updates:
Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 14 by pearu.peterson: TIFFimage and RGB
http://code.google.com/p/pylibtiff/issues/detail?id=14

It should be easy to add RGB support to TIFFimage.
For that the TIFFimage.write_file needs to be updated
such that PhotometricInterpretation=2 and SamplesPerPixel = 3.

The question is how the RGB data is stored in a numpy
array and how the pylibtiff code can recognise it as RGB.

Perhaps the easiest way would be to add rgb=False
kw option to TIFFimage.write_file and use proper
PhotometricInterpretation and SamplesPerPixel when rgb is True.

Can you test it and send a patch if it works?

pyli...@googlecode.com

unread,
Aug 23, 2011, 1:41:20 PM8/23/11
to pylibtif...@googlegroups.com

Comment #2 on issue 14 by tre...@gmail.com: TIFFimage and RGB
http://code.google.com/p/pylibtiff/issues/detail?id=14

here is the patch, it seems to work. i added some comments, excuse my
english.

Attachments:
tiff_image_RGB.patch 4.2 KB

pyli...@googlecode.com

unread,
Nov 8, 2011, 3:53:51 AM11/8/11
to pylibtif...@googlegroups.com
Updates:
Status: Accepted

Comment #3 on issue 14 by pearu.peterson: TIFFimage and RGB
http://code.google.com/p/pylibtiff/issues/detail?id=14

Btw, we have now the rgb writing support implemented, with slightly
different from the given patch. See test_rw_rgb in

http://code.google.com/p/pylibtiff/source/browse/trunk/libtiff/tests/test_tiff_image.py

for examples.

pyli...@googlecode.com

unread,
Sep 13, 2014, 6:06:18 PM9/13/14
to pylibtif...@googlegroups.com
Updates:
Status: Done

Comment #4 on issue 14 by pearu.peterson: TIFFimage and RGB
https://code.google.com/p/pylibtiff/issues/detail?id=14

(No comment was entered for this change.)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages