large-image-source-tiff

raw JSON →
1.34.1 verified Sat May 09 auth: no python

A TIFF tile source plugin for the large-image library, enabling efficient reading of tiled TIFF images (including BigTIFF, GeoTIFF, and multi-resolution pyramids). Current version: 1.34.1. Released as part of the large-image ecosystem; follows the main library's release cadence (approximately monthly).

pip install large-image-source-tiff
error ModuleNotFoundError: No module named 'large_image_source_tiff'
cause The package is not installed or is installed under a different distribution name.
fix
pip install large-image-source-tiff
error Failed to read TIFF header: Not a TIFF or unknown format
cause File is corrupted or not a valid TIFF, or the reader does not support compression.
fix
Verify file integrity, ensure TIFF is tiled, and install jpeg support: pip install large-image-source-tiff[jpeg]
error ImportError: cannot import name 'TiffFileTileSource' from 'large_image_source_tiff'
cause The class might be named differently or imported from the wrong path.
fix
Correct import: from large_image_source_tiff import TiffFileTileSource
error ValueError: tile size mismatch: expected (256, 256) but got (512, 512)
cause The TIFF has non-standard tile dimensions or the source is reading at the wrong level.
fix
Use source.getMetadata() to check tile size and level dimensions; specify correct level in getTile(x, y, level).
gotcha The source only supports regular TIFF files (uncompressed, tiled). It does not handle JPEG-compressed TIFFs unless the 'pylibtiff' extra is installed and configured. Check your TIFF compression before use.
fix Install with: pip install large-image-source-tiff[jpeg] or ensure your TIFF is tiled and uncompressed.
gotcha Third-party readers (openslide, pylibtiff) can alter behavior. If you have multiple readers installed, the source may pick one not intended. Force a specific reader by setting environment variable LARGE_IMAGE_TIFF_READER (e.g., 'tifffile', 'pylibtiff', 'openslide').
fix Set before import: os.environ['LARGE_IMAGE_TIFF_READER'] = 'tifffile'
deprecated The 'girder' extra mark indicates future removal. The package is marked for girder < 5.0. If using Girder, prepare to migrate away from this integration.
fix Use the library with large-image directly; avoid relying on Girder-specific features.
gotcha Reading a small region from a large tile can be wrong (fixed in v1.34.1). If using older versions, getTile() with sourceRegion may return incorrect data.
fix Upgrade to v1.34.1 or later; or use getRegion() with larger region requests.

Basic usage: create a TiffFileTileSource and retrieve a tile.

from large_image_source_tiff import TiffFileTileSource

# Open a TIFF file
source = TiffFileTileSource('path/to/image.tiff')

# Get basic metadata
print(source.getMetadata())

# Get a tile (x, y, z, format, encoding)
tile = source.getTile(0, 0, 0)
print('Tile data size:', len(tile))