Skip to main content

Read Carl Zeiss(r) Image (CZI) files

Project description

Czifile is a Python library to read Carl Zeiss Image (CZI) files, the native file format of the ZEN(r) software by Carl Zeiss Microscopy GmbH. CZI files contain multidimensional images and metadata from microscopy experiments.

Author:Christoph Gohlke
Organization:Laboratory for Fluorescence Dynamics. University of California, Irvine



Update copyright year.
Rename zisraw package to czifile.
Move and related modules into zisraw package. Move usage examples to main docstring. Require imagecodecs package for decoding JpegXrFile, JpgFile, and LZW.
Save CZI metadata to TIFF description in czi2tif. Fix AttributeError using max_workers=1. Make Segment.SID and DimensionEntryDV1.dimension str types. Return metadata as XML unicode string or dict, not etree. Return timestamps, focus positions, events, and luts as tuple or ndarray
Use multi-threading in CziFile.asarray to decode and copy segment data. Always convert BGR to RGB. Remove bgr2rgb options. Decode JpegXR directly from byte arrays.
Add function to convert CZI file to memory-mappable TIFF file.
Add ‘out’ parameter to CziFile.asarray. Remove memmap option from CziFile.asarray (backwards incompatible). Change spline interpolation order to 0 (backwards incompatible). Make axes return a string. Require tifffile 2017.7.11.
Read data into a memory mapped array (optional).
Decode JpegXrFile and JpgFile via _czifle extension module. Attempt to reconstruct tiled mosaic images.
Initial release.


The API is not stable yet and might change between revisions.

Python 2.7 and 3.4 are deprecated.

“ZEISS” and “Carl Zeiss” are registered trademarks of Carl Zeiss AG.

The ZISRAW file format design specification [1] is confidential and the licence agreement does not permit to write data into CZI files.

Only a subset of the 2016 specification is implemented. Specifically, multifile images, image pyramids, and topography images are not yet supported.

Tested on Windows with a few example files only.

Other libraries for reading CZI files (GPL licensed):


  1. ZISRAW (CZI) File Format Design specification Release Version 1.2.2. CZI 07-2016/CZI-DOC ZEN 2.3/DS_ZISRAW-FileFormat.pdf (confidential). Documentation can be requested at


Read image data from a CZI file as numpy array:

>>> image = imread('test.czi')
>>> image.shape
(3, 3, 3, 250, 200, 3)
>>> image[0, 0, 0, 0, 0]
array([10, 10, 10], dtype=uint8)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for czifile, version 2019.1.1
Filename, size File type Python version Upload date Hashes
Filename, size czifile-2019.1.1-py2.py3-none-any.whl (16.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size czifile-2019.1.1.tar.gz (16.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page