How to write compressed tif

88 views
Skip to first unread message

mse...@gmail.com

unread,
Jan 10, 2017, 3:26:38 AM1/10/17
to imageio
Hi,

I'm currently trying the imagio library for saving 16bit tiff images. Uncompressed (without using the meta data argument for writing) works fine. So how do I set the "compress" meta data?

I tried:
imageio.imwrite("D:\test.tif", ttt, format='TIFF', compress=9)
imageio.imwrite("D:\test.tif", ttt, format='TIFF', meta={'compress':9))

but I always get "TypeError: _open() got an unexpected keyword argument ..." I know I'm using the wrong call but I could not find any examples for using additional arguments for writing images

Thanks for your help,

Matthias

almar...@gmail.com

unread,
Jan 10, 2017, 6:28:36 AM1/10/17
to mse...@gmail.com, imageio

Hi Matthias,

 

The compression is indeed part of the meta data, but you cannot set that using imread. Try this:

 

with Imageio.get_writer(r‘D:\test.tif’) as w:

    w.append_data(ttt, {‘compress’: 9})

 

Regards,

  Almar

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages