Python wrapper for ImageJ

pip install imagej==0.3.1


PyImageJ: Python wrapper for ImageJ2 Forum Build Status

PyImageJ provides a set of wrapper functions for integration between ImageJ2 and Python. It also supports the original ImageJ API and data structures.

A major advantage of this approach is the ability to combine ImageJ and ImageJ2 with other tools available from the Python software ecosystem, including NumPy, SciPy, scikit-image, CellProfiler, OpenCV, ITK and many more.

Quick Start

Jump into the documentation and tutorials to get started!


PyImageJ can be installed using conda. Here is how to create and activate a new conda environment with PyImageJ available:

conda create -n pyimagej -c conda-forge pyimagej openjdk=8
conda activate pyimagej

Alternately, it is possible to install PyImageJ with pip.

For detailed installation instructions and requirements, see


The first step when using PyImageJ is to create an ImageJ2 gateway. This gateway can point to any official release of ImageJ2 or to a local installation. Using the gateway, you have full access to the ImageJ2 API, plus utility functions for translating between Python (NumPy, xarray, pandas, etc.) and Java (ImageJ2, ImgLib2, etc.) structures.

For instructions on how to start up the gateway for various settings, see

Here is an example of opening an image using ImageJ2 and displaying it:

# Create an ImageJ2 gateway with the newest available version of ImageJ2.
import imagej
ij = imagej.init()

# Load an image.
image_url = ''
jimage =

# Convert the image from ImageJ2 to xarray, a package that adds
# labeled datasets to numpy (
image =

# Display the image (backed by matplotlib)., cmap='gray')

For more, see the documentation and tutorials.

Getting Help

The Scientific Community Image Forum is the best place to get general help on usage of PyImageJ, ImageJ2, and any other image processing tasks. Bugs can be reported to the PyImageJ GitHub issue tracker.


All contributions, reports, and ideas are welcome. Contribution is done via pull requests onto the pyimagej repository.

Most development discussion takes place on the pyimagej GitHub repository. You can also reach the developers at the pyimagej gitter.