简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM