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.
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?
here is the patch, it seems to work. i added some comments, excuse my
english.
Attachments:
tiff_image_RGB.patch 4.2 KB
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.