Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIFFimage and RGB #14

Closed
GoogleCodeExporter opened this issue Aug 5, 2015 · 4 comments
Closed

TIFFimage and RGB #14

GoogleCodeExporter opened this issue Aug 5, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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.


Original issue reported on code.google.com by tre...@gmail.com on 23 Aug 2011 at 10:28

@GoogleCodeExporter
Copy link
Author

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?

Original comment by pearu.peterson on 23 Aug 2011 at 11:00

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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

Original comment by tre...@gmail.com on 23 Aug 2011 at 5:40

Attachments:

@GoogleCodeExporter
Copy link
Author

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_i
mage.py

for examples.

Original comment by pearu.peterson on 8 Nov 2011 at 8:52

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by pearu.peterson on 13 Sep 2014 at 10:05

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant