Writing multipage TIFF with Python

The best way to write multipage TIFF (all at once or via appending) on any platform (Windows, Mac, Linux) is to just use tifffile.py  by:

pip install tifffile

then

tifffile.imsave('myimages.tiff',imgs)

Where imgs.shape is (Nimg,y,x) for monochrome or (Nimg,y,x,3) for RGB color.

tifffile.imsave() is capable of description and tags arguments and for compress losslessly.

An advanced example is the file Demo_image_write_multipage.py

Alternative multipage-Tiff via scikit-image and FreeImage (recommend tifffile instead)

Windows scikit-image errors

RuntimeError: Could not find a FreeImage library

To fix:

  1. download the FreeImage DLL
  2. extract Dist/x64/FreeImage.dll to

     $(python -c "import skimage; print(skimage.__path__[0])")/io/_plugins/
    

Linux scikit-image errors

freeimage had a problem: Could not find a FreeImage library in any of…

To fix:

apt install libfreeimage3

reference