io.imsave() problems with passing arguments to plugin "freeimage"

Zachary Pincus zachary.pincus at yale.edu
Sat May 12 09:47:10 EDT 2012


Hi Siggi,

This functionality is not exposed by the imsave() apparatus, but can be accessed by the image writing functions in the plugin that imsave() calls.

A quick scan through the source code is likely to be the most helpful thing, regarding the available flags, etc:
https://github.com/scikits-image/scikits-image/blob/master/skimage/io/_plugins/freeimage_plugin.py

In particular, the freeimage_plugin.write() function, around which freeimage_plugin.imsave() is a thin wrapper, allows you to set various flags.
So:
import skimage.io._plugins.freeimage_plugin as fi
image = fi.read('/path/to/whatever')
fi.write(image, 'whatever.tif', fi.IO_FLAGS.TIFF_NONE)

Zach

On May 12, 2012, at 4:04 AM, Sigmund wrote:

> Hallo!
> To read uncompressed TIFF files I use the freeimage plugin. The reading works great but since last week I need to save a summed Image. I used the io.imsave() with the freeimage plugin but by default it writs a compressed TIFF file. The freeimage documentation provides Flags to use for different compressions or for a non compressed type (TIFF_NONE). Can someone tell me how to pass theses Flags to the plugin?
> I saw that Christophs 'tifffile' plugin does the job but still I would like to know how to use the freeimage plug-n for it.
> 
> Thanks!
> 
> Siggi




More information about the scikit-image mailing list