fabio
FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python
What it is and what it does
FabIO is a Python I/O library for reading and writing detector images from 2D X-ray diffraction experiments. It abstracts over 30 file formats from a dozen detector manufacturers into a unified interface: each image becomes a numpy array (data) plus an ordered dictionary of header metadata. The library handles formats ranging from simple TIFF and EDF to vendor-specific compressed formats like CBF and Pilatus, and supports HDF5-based formats like Eiger through h5py integration.
Typically used in synchrotron beamline software, crystallography pipelines, and scientific data processing workflows where detector images need to be read, inspected, and written without format-specific boilerplate. It includes convenience methods for statistics (min, max, mean, stddev), rebinning, and transparent decompression of gzip/bzip2 files. The package depends on numpy for array operations, h5py for HDF5 support, pillow for TIFF/image handling, lxml for XML formats, and filelock for concurrent access.
Use it for:
- Load CBF or EDF detector frames and access pixel data and experimental parameters via a uniform interface.
- Batch convert detector images between formats without writing format-specific code.
- Read HDF5-based Eiger detector stacks and extract 2D slices as numpy arrays for analysis.
- Build a data pipeline that accepts images from multiple detector types and processes them uniformly.
- Inspect detector image headers and statistics quickly without loading the full array into memory.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
FabIO reads and writes 2D X-ray detector images in 30 different formats from vendors like Mar, Dectris, ADSC, and Hamamatsu, exposing image data as numpy arrays and headers as Python dictionaries.
Yes, if you work with 2D X-ray detector images from synchrotron or laboratory diffraction systems. The library is actively maintained, permissively licensed (MIT primary), and eliminates format-specific parsing code. Medium install friction from compiled dependencies is acceptable for the breadth of format support. Not relevant for general image processing; consider only if your workflow involves detector formats like CBF, EDF, or Eiger.
Install
fabio on PyPI
pip
pip install fabiouv
uv add fabiopoetry
poetry add fabioInstalling fabio
Before you install
Medium install friction due to 6 runtime dependencies (numpy, h5py, hdf5plugin, lxml, pillow, filelock) and compiled C/Cython components. Actively maintained with recent release 56 days ago and ongoing repository activity.
License in practice
Primarily MIT-licensed with permissive treatment. Some components use LGPL-3.0+ and GPL-2.0+; verify compatibility if redistributing or modifying for proprietary use.
Quickstart
import fabio
obj = fabio.open("mydata0000.edf")
print(obj.data.shape)
print(obj.header["Omega"])
Requires h5py and hdf5plugin for HDF5/Eiger format support; gzip and bzip2 modules needed for transparent compressed file handling.
Verify before relying
- Whether all 30 file formats are equally well-tested or if some are rarely used
- Performance characteristics for large detector images or batch processing
- Exact Python version support floor (requires >=3.11 but earliest tested version unclear)
Package facts
| License | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: fabio Upstream-Contact: Jérôme Kieffer <kieffer@esrf.eu> Source:… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 6 — numpy, h5py, hdf5plugin, lxml, pillow, filelock |
| Maintenance | actively maintained — 56 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,074/month — #13,233 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fabio-2026.6.0-cp311-cp311-macosx_10_9_x86_64.whl; fabio-2026.6.0-cp311-cp311-macosx_11_0_arm64.whl; fabio-2026.6.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; fabio-2026.6.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; fabio-2026.6.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; fabio-2026.6.0-cp311-cp311-win_amd64.whl; fabio-2026.6.0-cp312-cp312-macosx_10_13_x86_64.whl; fabio-2026.6.0-cp312-cp312-macosx_11_0_arm64.whl; fabio-2026.6.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; fabio-2026.6.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; fabio-2026.6.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; fabio-2026.6.0-cp312-cp312-win_amd64.whl; fabio-2026.6.0-cp313-cp313-macosx_10_13_x86_64.whl; fabio-2026.6.0-cp313-cp313-macosx_11_0_arm64.whl; fabio-2026.6.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; fabio-2026.6.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; fabio-2026.6.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; fabio-2026.6.0-cp313-cp313-win_amd64.whl; fabio-2026.6.0-cp314-cp314-macosx_11_0_arm64.whl; fabio-2026.6.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
silxsilx provides Python tools for reading,…
permissive · top 15,000 on PyPI
tifffileRead and write TIFF files and TIFF-like formats…
permissive · top 1,000 on PyPI
cmcrameriProvides perceptually uniform colormaps by…
permissive · top 15,000 on PyPI
edfioedfio reads and writes EDF, EDF+C, BDF, and…
permissive · top 15,000 on PyPI
rosettasciioRosettaSciIO reads and writes scientific data…
copyleft · top 15,000 on PyPI
RoffIORoffio reads and writes Roxar Open File Format…
copyleft · top 15,000 on PyPI
ImageIOImageIO reads and writes images and video in…
permissive · top 1,000 on PyPI
pyEDFlibpyEDFlib reads and writes EDF+/BDF+ biomedical…
permissive · top 15,000 on PyPI
roifileRead, write, create, and plot ImageJ ROI format…
permissive · top 15,000 on PyPI