Enucatl
Enucatl

Reputation: 507

How to save 32/64 bit grayscale floats to TIFF with matplotlib?

I'm trying to save some arrays as TIFF with matplotlib, but I'm getting 24 bit RGB files instead with plt.imsave().

Can I change that without resorting to the PIL? It's quite important for me to keep everything in pure matplotlib.

Upvotes: 0

Views: 1023

Answers (1)

Thorsten Kranz
Thorsten Kranz

Reputation: 12755

Using matplotlib to export to TIFF will use PIL anyway. As far as I know, matplotlib has native support only for PNG, and uses PIL to convert to other file formats. So when you are using matplotlib to export to TIFF, you can use PIL immediately.

Upvotes: 2

Related Questions