tifffile 2025.6.1


pip install tifffile

  Latest version

Released: Jun 02, 2025


Meta
Author: Christoph Gohlke
Requires Python: >=3.11

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Science/Research
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python :: 3 :: Only
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Tifffile is a Python library to

  1. store NumPy arrays in TIFF (Tagged Image File Format) files, and

  2. read image and metadata from TIFF-like files used in bioimaging.

Image and metadata can be read from TIFF, BigTIFF, OME-TIFF, GeoTIFF, Adobe DNG, ZIF (Zoomable Image File Format), MetaMorph STK, Zeiss LSM, ImageJ hyperstack, Micro-Manager MMStack and NDTiff, SGI, NIHImage, Olympus FluoView and SIS, ScanImage, Molecular Dynamics GEL, Aperio SVS, Leica SCN, Roche BIF, PerkinElmer QPTIFF (QPI, PKI), Hamamatsu NDPI, Argos AVS, and Philips DP formatted files.

Image data can be read as NumPy arrays or Zarr arrays/groups from strips, tiles, pages (IFDs), SubIFDs, higher-order series, and pyramidal levels.

Image data can be written to TIFF, BigTIFF, OME-TIFF, and ImageJ hyperstack compatible files in multi-page, volumetric, pyramidal, memory-mappable, tiled, predicted, or compressed form.

Many compression and predictor schemes are supported via the imagecodecs library, including LZW, PackBits, Deflate, PIXTIFF, LZMA, LERC, Zstd, JPEG (8 and 12-bit, lossless), JPEG 2000, JPEG XR, JPEG XL, WebP, PNG, EER, Jetraw, 24-bit floating-point, and horizontal differencing.

Tifffile can also be used to inspect TIFF structures, read image data from multi-dimensional file sequences, write fsspec ReferenceFileSystem for TIFF files and image file sequences, patch TIFF tag values, and parse many proprietary metadata formats.

Author:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2025.6.1

DOI:

10.5281/zenodo.6795860

Quickstart

Install the tifffile package and all dependencies from the Python Package Index:

python -m pip install -U tifffile[all]

Tifffile is also available in other package repositories such as Anaconda, Debian, and MSYS2.

The tifffile library is type annotated and documented via docstrings:

python -c "import tifffile; help(tifffile)"

Tifffile can be used as a console script to inspect and preview TIFF files:

python -m tifffile --help

See Examples for using the programming interface.

Source code and support are available on GitHub.

Support is also provided on the image.sc forum.

Requirements

This revision was tested with the following requirements and dependencies (other versions may work):

  • CPython 3.11.9, 3.12.10, 3.13.3 3.14.0b2 64-bit

  • NumPy 2.2.6

  • Imagecodecs 2025.3.30 (required for encoding or decoding LZW, JPEG, etc. compressed segments)

  • Matplotlib 3.10.3 (required for plotting)

  • Lxml 5.4.0 (required only for validating and printing XML)

  • Zarr 3.0.8 (required only for using Zarr stores; Zarr 2 is not compatible)

  • Kerchunk 0.2.8 (required only for opening ReferenceFileSystem files)

Revisions

2025.6.1

  • Pass 5110 tests.

  • Add experimental option to write iterator of bytes and bytecounts (#301).

2025.5.26

  • Use threads in Zarr stores.

2025.5.24

  • Fix incorrect tags created by Philips DP v1.1 (#299).

  • Make Zarr stores partially listable.

2025.5.21

  • Move Zarr stores to tifffile.zarr namespace (breaking).

  • Require Zarr 3 for Zarr stores and remove support for Zarr 2 (breaking).

  • Drop support for Python 3.10.

2025.5.10

  • Raise ValueError when using zarr 3 (#296).

  • Fall back to compression.zstd on Python >= 3.14 if no imagecodecs.

  • Remove doctest command line option.

  • Support Python 3.14.

2025.3.30

  • Fix for imagecodecs 2025.3.30.

2025.3.13

  • Change bytes2str to decode only up to first NULL character (breaking).

  • Remove stripnull function calls to reduce overhead (#285).

  • Deprecate stripnull function.

2025.2.18

  • Fix julian_datetime milliseconds (#283).

  • Remove deprecated dtype arguments from imread and FileSequence (breaking).

  • Remove deprecated imsave and TiffWriter.save function/method (breaking).

  • Remove deprecated option to pass multiple values to compression (breaking).

  • Remove deprecated option to pass unit to resolution (breaking).

  • Remove deprecated enums from TIFF namespace (breaking).

  • Remove deprecated lazyattr and squeeze_axes functions (breaking).

2025.1.10

  • Improve type hints.

  • Deprecate Python 3.10.

2024.12.12

  • Read PlaneProperty from STK UIC1Tag (#280).

  • Allow ‘None’ as alias for COMPRESSION.NONE and PREDICTOR.NONE (#274).

  • Zarr 3 is not supported (#272).

2024.9.20

  • Fix writing colormap to ImageJ files (breaking).

  • Improve typing.

  • Drop support for Python 3.9.

2024.8.30

  • Support writing OME Dataset and some StructuredAnnotations elements.

2024.8.28

  • Fix LSM scan types and dimension orders (#269, breaking).

  • Use IO[bytes] instead of BinaryIO for typing (#268).

2024.8.24

  • Do not remove trailing length-1 dimension writing non-shaped file (breaking).

  • Fix writing OME-TIFF with certain modulo axes orders.

  • Make imshow NaN aware.

2024.8.10

  • Relax bitspersample check for JPEG, JPEG2K, and JPEGXL compression (#265).

2024.7.24

  • Fix reading contiguous multi-page series via Zarr store (#67).

2024.7.21

  • Fix integer overflow in product function caused by numpy types.

  • Allow tag reader functions to fail.

2024.7.2

  • Enable memmap to create empty files with non-native byte order.

  • Deprecate Python 3.9, support Python 3.13.

2024.6.18

  • Ensure TiffPage.nodata is castable to dtype (breaking, #260).

  • Support Argos AVS slides.

2024.5.22

  • Derive TiffPages, TiffPageSeries, FileSequence, StoredShape from Sequence.

  • Truncate circular IFD chain, do not raise TiffFileError (breaking).

  • Deprecate access to TiffPages.pages and FileSequence.files.

  • Enable DeprecationWarning for enums in TIFF namespace.

  • Remove some deprecated code (breaking).

  • Add iccprofile property to TiffPage and parameter to TiffWriter.write.

  • Do not detect VSI as SIS format.

  • Limit length of logged exception messages.

  • Fix docstring examples not correctly rendered on GitHub (#254, #255).

Refer to the CHANGES file for older revisions.

Notes

TIFF, the Tagged Image File Format, was created by the Aldus Corporation and Adobe Systems Incorporated.

Tifffile supports a subset of the TIFF6 specification, mainly 8, 16, 32, and 64-bit integer, 16, 32, and 64-bit float, grayscale and multi-sample images. Specifically, CCITT and OJPEG compression, chroma subsampling without JPEG compression, color space transformations, samples with differing types, or IPTC, ICC, and XMP metadata are not implemented.

Besides classic TIFF, tifffile supports several TIFF-like formats that do not strictly adhere to the TIFF6 specification. Some formats allow file and data sizes to exceed the 4 GB limit of the classic TIFF:

  • BigTIFF is identified by version number 43 and uses different file header, IFD, and tag structures with 64-bit offsets. The format also adds 64-bit data types. Tifffile can read and write BigTIFF files.

  • ImageJ hyperstacks store all image data, which may exceed 4 GB, contiguously after the first IFD. Files > 4 GB contain one IFD only. The size and shape of the up to 6-dimensional image data can be determined from the ImageDescription tag of the first IFD, which is Latin-1 encoded. Tifffile can read and write ImageJ hyperstacks.

  • OME-TIFF files store up to 8-dimensional image data in one or multiple TIFF or BigTIFF files. The UTF-8 encoded OME-XML metadata found in the ImageDescription tag of the first IFD defines the position of TIFF IFDs in the high-dimensional image data. Tifffile can read OME-TIFF files (except multi-file pyramidal) and write NumPy arrays to single-file OME-TIFF.

  • Micro-Manager NDTiff stores multi-dimensional image data in one or more classic TIFF files. Metadata contained in a separate NDTiff.index binary file defines the position of the TIFF IFDs in the image array. Each TIFF file also contains metadata in a non-TIFF binary structure at offset 8. Downsampled image data of pyramidal datasets are stored in separate folders. Tifffile can read NDTiff files. Version 0 and 1 series, tiling, stitching, and multi-resolution pyramids are not supported.

  • Micro-Manager MMStack stores 6-dimensional image data in one or more classic TIFF files. Metadata contained in non-TIFF binary structures and JSON strings define the image stack dimensions and the position of the image frame data in the file and the image stack. The TIFF structures and metadata are often corrupted or wrong. Tifffile can read MMStack files.

  • Carl Zeiss LSM files store all IFDs below 4 GB and wrap around 32-bit StripOffsets pointing to image data above 4 GB. The StripOffsets of each series and position require separate unwrapping. The StripByteCounts tag contains the number of bytes for the uncompressed data. Tifffile can read LSM files of any size.

  • MetaMorph Stack, STK files contain additional image planes stored contiguously after the image data of the first page. The total number of planes is equal to the count of the UIC2tag. Tifffile can read STK files.

  • ZIF, the Zoomable Image File format, is a subspecification of BigTIFF with SGI’s ImageDepth extension and additional compression schemes. Only little-endian, tiled, interleaved, 8-bit per sample images with JPEG, PNG, JPEG XR, and JPEG 2000 compression are allowed. Tifffile can read and write ZIF files.

  • Hamamatsu NDPI files use some 64-bit offsets in the file header, IFD, and tag structures. Single, LONG typed tag values can exceed 32-bit. The high bytes of 64-bit tag values and offsets are stored after IFD structures. Tifffile can read NDPI files > 4 GB. JPEG compressed segments with dimensions >65530 or missing restart markers cannot be decoded with common JPEG libraries. Tifffile works around this limitation by separately decoding the MCUs between restart markers, which performs poorly. BitsPerSample, SamplesPerPixel, and PhotometricInterpretation tags may contain wrong values, which can be corrected using the value of tag 65441.

  • Philips TIFF slides store padded ImageWidth and ImageLength tag values for tiled pages. The values can be corrected using the DICOM_PIXEL_SPACING attributes of the XML formatted description of the first page. Tile offsets and byte counts may be 0. Tifffile can read Philips slides.

  • Ventana/Roche BIF slides store tiles and metadata in a BigTIFF container. Tiles may overlap and require stitching based on the TileJointInfo elements in the XMP tag. Volumetric scans are stored using the ImageDepth extension. Tifffile can read BIF and decode individual tiles but does not perform stitching.

  • ScanImage optionally allows corrupted non-BigTIFF files > 2 GB. The values of StripOffsets and StripByteCounts can be recovered using the constant differences of the offsets of IFD and tag values throughout the file. Tifffile can read such files if the image data are stored contiguously in each page.

  • GeoTIFF sparse files allow strip or tile offsets and byte counts to be 0. Such segments are implicitly set to 0 or the NODATA value on reading. Tifffile can read GeoTIFF sparse files.

  • Tifffile shaped files store the array shape and user-provided metadata of multi-dimensional image series in JSON format in the ImageDescription tag of the first page of the series. The format allows multiple series, SubIFDs, sparse segments with zero offset and byte count, and truncated series, where only the first page of a series is present, and the image data are stored contiguously. No other software besides Tifffile supports the truncated format.

Other libraries for reading, writing, inspecting, or manipulating scientific TIFF files from Python are aicsimageio, apeer-ometiff-library, bigtiff, fabio.TiffIO, GDAL, imread, large_image, openslide-python, opentile, pylibtiff, pylsm, pymimage, python-bioformats, pytiff, scanimagetiffreader-python, SimpleITK, slideio, tiffslide, tifftools, tyf, xtiff, and ndtiff.

References

Examples

Write a NumPy array to a single-page RGB TIFF file:

>>> import numpy
>>> data = numpy.random.randint(0, 255, (256, 256, 3), 'uint8')
>>> imwrite('temp.tif', data, photometric='rgb')

Read the image from the TIFF file as NumPy array:

>>> image = imread('temp.tif')
>>> image.shape
(256, 256, 3)

Use the photometric and planarconfig arguments to write a 3x3x3 NumPy array to an interleaved RGB, a planar RGB, or a 3-page grayscale TIFF:

>>> data = numpy.random.randint(0, 255, (3, 3, 3), 'uint8')
>>> imwrite('temp.tif', data, photometric='rgb')
>>> imwrite('temp.tif', data, photometric='rgb', planarconfig='separate')
>>> imwrite('temp.tif', data, photometric='minisblack')

Use the extrasamples argument to specify how extra components are interpreted, for example, for an RGBA image with unassociated alpha channel:

>>> data = numpy.random.randint(0, 255, (256, 256, 4), 'uint8')
>>> imwrite('temp.tif', data, photometric='rgb', extrasamples=['unassalpha'])

Write a 3-dimensional NumPy array to a multi-page, 16-bit grayscale TIFF file:

>>> data = numpy.random.randint(0, 2**12, (64, 301, 219), 'uint16')
>>> imwrite('temp.tif', data, photometric='minisblack')

Read the whole image stack from the multi-page TIFF file as NumPy array:

>>> image_stack = imread('temp.tif')
>>> image_stack.shape
(64, 301, 219)
>>> image_stack.dtype
dtype('uint16')

Read the image from the first page in the TIFF file as NumPy array:

>>> image = imread('temp.tif', key=0)
>>> image.shape
(301, 219)

Read images from a selected range of pages:

>>> images = imread('temp.tif', key=range(4, 40, 2))
>>> images.shape
(18, 301, 219)

Iterate over all pages in the TIFF file and successively read images:

>>> with TiffFile('temp.tif') as tif:
...     for page in tif.pages:
...         image = page.asarray()
...

Get information about the image stack in the TIFF file without reading any image data:

>>> tif = TiffFile('temp.tif')
>>> len(tif.pages)  # number of pages in the file
64
>>> page = tif.pages[0]  # get shape and dtype of image in first page
>>> page.shape
(301, 219)
>>> page.dtype
dtype('uint16')
>>> page.axes
'YX'
>>> series = tif.series[0]  # get shape and dtype of first image series
>>> series.shape
(64, 301, 219)
>>> series.dtype
dtype('uint16')
>>> series.axes
'QYX'
>>> tif.close()

Inspect the “XResolution” tag from the first page in the TIFF file:

>>> with TiffFile('temp.tif') as tif:
...     tag = tif.pages[0].tags['XResolution']
...
>>> tag.value
(1, 1)
>>> tag.name
'XResolution'
>>> tag.code
282
>>> tag.count
1
>>> tag.dtype
<DATATYPE.RATIONAL: 5>

Iterate over all tags in the TIFF file:

>>> with TiffFile('temp.tif') as tif:
...     for page in tif.pages:
...         for tag in page.tags:
...             tag_name, tag_value = tag.name, tag.value
...

Overwrite the value of an existing tag, for example, XResolution:

>>> with TiffFile('temp.tif', mode='r+') as tif:
...     _ = tif.pages[0].tags['XResolution'].overwrite((96000, 1000))
...

Write a 5-dimensional floating-point array using BigTIFF format, separate color components, tiling, Zlib compression level 8, horizontal differencing predictor, and additional metadata:

>>> data = numpy.random.rand(2, 5, 3, 301, 219).astype('float32')
>>> imwrite(
...     'temp.tif',
...     data,
...     bigtiff=True,
...     photometric='rgb',
...     planarconfig='separate',
...     tile=(32, 32),
...     compression='zlib',
...     compressionargs={'level': 8},
...     predictor=True,
...     metadata={'axes': 'TZCYX'},
... )

Write a 10 fps time series of volumes with xyz voxel size 2.6755x2.6755x3.9474 micron^3 to an ImageJ hyperstack formatted TIFF file:

>>> volume = numpy.random.randn(6, 57, 256, 256).astype('float32')
>>> image_labels = [f'{i}' for i in range(volume.shape[0] * volume.shape[1])]
>>> imwrite(
...     'temp.tif',
...     volume,
...     imagej=True,
...     resolution=(1.0 / 2.6755, 1.0 / 2.6755),
...     metadata={
...         'spacing': 3.947368,
...         'unit': 'um',
...         'finterval': 1 / 10,
...         'fps': 10.0,
...         'axes': 'TZYX',
...         'Labels': image_labels,
...     },
... )

Read the volume and metadata from the ImageJ hyperstack file:

>>> with TiffFile('temp.tif') as tif:
...     volume = tif.asarray()
...     axes = tif.series[0].axes
...     imagej_metadata = tif.imagej_metadata
...
>>> volume.shape
(6, 57, 256, 256)
>>> axes
'TZYX'
>>> imagej_metadata['slices']
57
>>> imagej_metadata['frames']
6

Memory-map the contiguous image data in the ImageJ hyperstack file:

>>> memmap_volume = memmap('temp.tif')
>>> memmap_volume.shape
(6, 57, 256, 256)
>>> del memmap_volume

Create a TIFF file containing an empty image and write to the memory-mapped NumPy array (note: this does not work with compression or tiling):

>>> memmap_image = memmap(
...     'temp.tif', shape=(256, 256, 3), dtype='float32', photometric='rgb'
... )
>>> type(memmap_image)
<class 'numpy.memmap'>
>>> memmap_image[255, 255, 1] = 1.0
>>> memmap_image.flush()
>>> del memmap_image

Write two NumPy arrays to a multi-series TIFF file (note: other TIFF readers will not recognize the two series; use the OME-TIFF format for better interoperability):

>>> series0 = numpy.random.randint(0, 255, (32, 32, 3), 'uint8')
>>> series1 = numpy.random.randint(0, 255, (4, 256, 256), 'uint16')
>>> with TiffWriter('temp.tif') as tif:
...     tif.write(series0, photometric='rgb')
...     tif.write(series1, photometric='minisblack')
...

Read the second image series from the TIFF file:

>>> series1 = imread('temp.tif', series=1)
>>> series1.shape
(4, 256, 256)

Successively write the frames of one contiguous series to a TIFF file:

>>> data = numpy.random.randint(0, 255, (30, 301, 219), 'uint8')
>>> with TiffWriter('temp.tif') as tif:
...     for frame in data:
...         tif.write(frame, contiguous=True)
...

Append an image series to the existing TIFF file (note: this does not work with ImageJ hyperstack or OME-TIFF files):

>>> data = numpy.random.randint(0, 255, (301, 219, 3), 'uint8')
>>> imwrite('temp.tif', data, photometric='rgb', append=True)

Create a TIFF file from a generator of tiles:

>>> data = numpy.random.randint(0, 2**12, (31, 33, 3), 'uint16')
>>> def tiles(data, tileshape):
...     for y in range(0, data.shape[0], tileshape[0]):
...         for x in range(0, data.shape[1], tileshape[1]):
...             yield data[y : y + tileshape[0], x : x + tileshape[1]]
...
>>> imwrite(
...     'temp.tif',
...     tiles(data, (16, 16)),
...     tile=(16, 16),
...     shape=data.shape,
...     dtype=data.dtype,
...     photometric='rgb',
... )

Write a multi-dimensional, multi-resolution (pyramidal), multi-series OME-TIFF file with optional metadata. Sub-resolution images are written to SubIFDs. Limit parallel encoding to 2 threads. Write a thumbnail image as a separate image series:

>>> data = numpy.random.randint(0, 255, (8, 2, 512, 512, 3), 'uint8')
>>> subresolutions = 2
>>> pixelsize = 0.29  # micrometer
>>> with TiffWriter('temp.ome.tif', bigtiff=True) as tif:
...     metadata = {
...         'axes': 'TCYXS',
...         'SignificantBits': 8,
...         'TimeIncrement': 0.1,
...         'TimeIncrementUnit': 's',
...         'PhysicalSizeX': pixelsize,
...         'PhysicalSizeXUnit': 'µm',
...         'PhysicalSizeY': pixelsize,
...         'PhysicalSizeYUnit': 'µm',
...         'Channel': {'Name': ['Channel 1', 'Channel 2']},
...         'Plane': {'PositionX': [0.0] * 16, 'PositionXUnit': ['µm'] * 16},
...         'Description': 'A multi-dimensional, multi-resolution image',
...         'MapAnnotation': {  # for OMERO
...             'Namespace': 'openmicroscopy.org/PyramidResolution',
...             '1': '256 256',
...             '2': '128 128',
...         },
...     }
...     options = dict(
...         photometric='rgb',
...         tile=(128, 128),
...         compression='jpeg',
...         resolutionunit='CENTIMETER',
...         maxworkers=2,
...     )
...     tif.write(
...         data,
...         subifds=subresolutions,
...         resolution=(1e4 / pixelsize, 1e4 / pixelsize),
...         metadata=metadata,
...         **options,
...     )
...     # write pyramid levels to the two subifds
...     # in production use resampling to generate sub-resolution images
...     for level in range(subresolutions):
...         mag = 2 ** (level + 1)
...         tif.write(
...             data[..., ::mag, ::mag, :],
...             subfiletype=1,
...             resolution=(1e4 / mag / pixelsize, 1e4 / mag / pixelsize),
...             **options,
...         )
...     # add a thumbnail image as a separate series
...     # it is recognized by QuPath as an associated image
...     thumbnail = (data[0, 0, ::8, ::8] >> 2).astype('uint8')
...     tif.write(thumbnail, metadata={'Name': 'thumbnail'})
...

Access the image levels in the pyramidal OME-TIFF file:

>>> baseimage = imread('temp.ome.tif')
>>> second_level = imread('temp.ome.tif', series=0, level=1)
>>> with TiffFile('temp.ome.tif') as tif:
...     baseimage = tif.series[0].asarray()
...     second_level = tif.series[0].levels[1].asarray()
...     number_levels = len(tif.series[0].levels)  # includes base level
...

Iterate over and decode single JPEG compressed tiles in the TIFF file:

>>> with TiffFile('temp.ome.tif') as tif:
...     fh = tif.filehandle
...     for page in tif.pages:
...         for index, (offset, bytecount) in enumerate(
...             zip(page.dataoffsets, page.databytecounts)
...         ):
...             _ = fh.seek(offset)
...             data = fh.read(bytecount)
...             tile, indices, shape = page.decode(
...                 data, index, jpegtables=page.jpegtables
...             )
...

Use Zarr to read parts of the tiled, pyramidal images in the TIFF file:

>>> import zarr
>>> store = imread('temp.ome.tif', aszarr=True)
>>> z = zarr.open(store, mode='r')
>>> z
<Group ZarrTiffStore>
>>> z['0']  # base layer
 <Array ZarrTiffStore/0 shape=(8, 2, 512, 512, 3) dtype=uint8>
>>> z['0'][2, 0, 128:384, 256:].shape  # read a tile from the base layer
(256, 256, 3)
>>> store.close()

Load the base layer from the Zarr store as a dask array:

>>> import dask.array
>>> store = imread('temp.ome.tif', aszarr=True)
>>> dask.array.from_zarr(store, '0', zarr_format=2)
dask.array<...shape=(8, 2, 512, 512, 3)...chunksize=(1, 1, 128, 128, 3)...
>>> store.close()

Write the Zarr store to a fsspec ReferenceFileSystem in JSON format:

>>> store = imread('temp.ome.tif', aszarr=True)
>>> store.write_fsspec('temp.ome.tif.json', url='file://')
>>> store.close()

Open the fsspec ReferenceFileSystem as a Zarr group:

>>> from kerchunk.utils import refs_as_store
>>> import imagecodecs.numcodecs
>>> imagecodecs.numcodecs.register_codecs(verbose=False)
>>> z = zarr.open(refs_as_store('temp.ome.tif.json'), mode='r')
>>> z
<Group <FsspecStore(ReferenceFileSystem, /)>>

Create an OME-TIFF file containing an empty, tiled image series and write to it via the Zarr interface (note: this does not work with compression):

>>> imwrite(
...     'temp2.ome.tif',
...     shape=(8, 800, 600),
...     dtype='uint16',
...     photometric='minisblack',
...     tile=(128, 128),
...     metadata={'axes': 'CYX'},
... )
>>> store = imread('temp2.ome.tif', mode='r+', aszarr=True)
>>> z = zarr.open(store, mode='r+')
>>> z
<Array ZarrTiffStore shape=(8, 800, 600) dtype=uint16>
>>> z[3, 100:200, 200:300:2] = 1024
>>> store.close()

Read images from a sequence of TIFF files as NumPy array using two I/O worker threads:

>>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
>>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
>>> image_sequence = imread(
...     ['temp_C001T001.tif', 'temp_C001T002.tif'], ioworkers=2, maxworkers=1
... )
>>> image_sequence.shape
(2, 64, 64)
>>> image_sequence.dtype
dtype('float64')

Read an image stack from a series of TIFF files with a file name pattern as NumPy or Zarr arrays:

>>> image_sequence = TiffSequence('temp_C0*.tif', pattern=r'_(C)(\d+)(T)(\d+)')
>>> image_sequence.shape
(1, 2)
>>> image_sequence.axes
'CT'
>>> data = image_sequence.asarray()
>>> data.shape
(1, 2, 64, 64)
>>> store = image_sequence.aszarr()
>>> zarr.open(store, mode='r', ioworkers=2, maxworkers=1)
<Array ZarrFileSequenceStore shape=(1, 2, 64, 64) dtype=float64>
>>> image_sequence.close()

Write the Zarr store to a fsspec ReferenceFileSystem in JSON format:

>>> store = image_sequence.aszarr()
>>> store.write_fsspec('temp.json', url='file://')

Open the fsspec ReferenceFileSystem as a Zarr array:

>>> from kerchunk.utils import refs_as_store
>>> import tifffile.numcodecs
>>> tifffile.numcodecs.register_codec()
>>> zarr.open(refs_as_store('temp.json'), mode='r')
<Array <FsspecStore(ReferenceFileSystem, /)> shape=(1, 2, 64, 64) ...>

Inspect the TIFF file from the command line:

$ python -m tifffile temp.ome.tif
2025.6.1 Jun 02, 2025
2025.5.26 May 26, 2025
2025.5.24 May 24, 2025
2025.5.21 May 22, 2025
2025.5.10 May 10, 2025
2025.3.30 Mar 30, 2025
2025.3.13 Mar 14, 2025
2025.2.18 Feb 19, 2025
2025.1.10 Jan 10, 2025
2024.12.12 Dec 13, 2024
2024.9.20 Sep 20, 2024
2024.8.30 Aug 31, 2024
2024.8.28 Aug 28, 2024
2024.8.24 Aug 25, 2024
2024.8.10 Aug 11, 2024
2024.7.24 Jul 24, 2024
2024.7.21 Jul 21, 2024
2024.7.2 Jul 03, 2024
2024.6.18 Jun 18, 2024
2024.5.22 May 23, 2024
2024.5.10 May 10, 2024
2024.5.3 May 04, 2024
2024.4.24 Apr 25, 2024
2024.4.18 Apr 18, 2024
2024.2.12 Feb 12, 2024
2024.1.30 Jan 29, 2024
2023.12.9 Dec 09, 2023
2023.9.26 Sep 27, 2023
2023.9.18 Sep 19, 2023
2023.8.30 Aug 31, 2023
2023.8.25 Aug 26, 2023
2023.8.12 Aug 13, 2023
2023.7.18 Jul 19, 2023
2023.7.10 Jul 11, 2023
2023.7.4 Jul 04, 2023
2023.4.12 Apr 13, 2023
2023.3.21 Mar 22, 2023
2023.3.15 Mar 15, 2023
2023.2.28 Mar 01, 2023
2023.2.27 Feb 27, 2023
2023.2.3 Feb 05, 2023
2023.2.2 Feb 03, 2023
2023.1.23.1 Jan 23, 2023
2023.1.23 Jan 23, 2023
2022.10.10 Oct 11, 2022
2022.8.12 Aug 12, 2022
2022.8.8 Aug 08, 2022
2022.8.3 Aug 03, 2022
2022.7.31 Aug 01, 2022
2022.7.28 Jul 29, 2022
2022.5.4 May 04, 2022
2022.4.28 Apr 29, 2022
2022.4.26 Apr 26, 2022
2022.4.22 Apr 22, 2022
2022.4.8 Apr 08, 2022
2022.3.25 Mar 25, 2022
2022.3.16 Mar 16, 2022
2022.2.9 Feb 09, 2022
2022.2.2 Feb 03, 2022
2021.11.2 Nov 02, 2021
2021.10.12 Oct 13, 2021
2021.10.10 Oct 09, 2021
2021.8.30 Aug 31, 2021
2021.8.8 Aug 09, 2021
2021.7.30 Jul 30, 2021
2021.7.2 Jul 03, 2021
2021.6.14 Jun 14, 2021
2021.6.6 Jun 07, 2021
2021.4.8 Apr 09, 2021
2021.3.31 Apr 01, 2021
2021.3.17 Mar 17, 2021
2021.3.16 Mar 16, 2021
2021.3.5 Mar 05, 2021
2021.3.4 Mar 04, 2021
2021.2.26 Feb 26, 2021
2021.2.1 Feb 02, 2021
2021.1.14 Jan 15, 2021
2021.1.11 Jan 12, 2021
2021.1.8 Jan 09, 2021
2020.12.8 Dec 09, 2020
2020.12.4 Dec 04, 2020
2020.11.26 Nov 27, 2020
2020.11.18 Nov 19, 2020
2020.10.1 Oct 01, 2020
2020.9.30 Oct 01, 2020
2020.9.29 Sep 29, 2020
2020.9.28 Sep 28, 2020
2020.9.22 Sep 23, 2020
2020.9.3 Sep 04, 2020
2020.8.25 Aug 26, 2020
2020.8.13 Aug 13, 2020
2020.7.24 Jul 25, 2020
2020.7.22 Jul 23, 2020
2020.7.17 Jul 18, 2020
2020.7.4 Jul 05, 2020
2020.6.3 Jun 04, 2020
2020.5.30 May 31, 2020
2020.5.25 May 26, 2020
2020.5.11 May 11, 2020
2020.5.7 May 07, 2020
2020.5.5 May 05, 2020
2020.2.16 Feb 16, 2020
2019.7.26.2 Dec 03, 2019
2019.7.26 Jul 26, 2019
2019.7.20 Jul 22, 2019
2019.7.2 Jul 03, 2019
2019.6.18 Jun 20, 2019
2019.5.30 Jun 02, 2019
2019.5.22 May 25, 2019
2019.3.18 Mar 27, 2019
2019.3.8 Mar 09, 2019
2019.2.22 Feb 24, 2019
2019.2.10 Feb 13, 2019
2019.1.30 Jan 31, 2019
2019.1.4 Jan 04, 2019
2019.1.1 Jan 03, 2019
2018.11.28 Dec 01, 2018
2018.11.6 Nov 06, 2018
2018.10.18 Oct 19, 2018
0.15.1 Jul 23, 2018
0.15.0 Jul 07, 2018
0.14.0 Feb 20, 2018
0.13.5 Jan 20, 2018
0.13.4 Jan 17, 2018
0.13.2 Jan 17, 2018
0.13.1 Jan 17, 2018
0.13.0 Jan 10, 2018
0.12.1 May 25, 2017
0.12.0 Apr 13, 2017
0.11.1 Feb 10, 2017
0.11.0 Feb 10, 2017
0.10.0 Nov 22, 2016
0.9.2 Jun 01, 2016
0.9.1 Jun 01, 2016
0.9.0 Apr 20, 2016
0.8.0 Mar 16, 2016
0.7.0 Aug 24, 2015
0.6.2 Jun 18, 2015
0.6.1 Jun 15, 2015
0.6.0 Jun 13, 2015
0.5 Jun 09, 2015
0.4 Dec 13, 2014
0.3.3 Oct 16, 2014
0.3.2 Oct 16, 2014
0.3.1 Oct 13, 2014
0.3.0 Oct 13, 2014
0.2.0 Oct 12, 2014
0.1.0 Oct 11, 2014

Wheel compatibility matrix

Platform Python 3
any

Files in release