Dask-Image

2025.11.0 · active · verified Thu Apr 16

Dask-Image provides distributed image processing capabilities built on Dask, enabling scalable operations on large image datasets that exceed memory. It is currently at version 2025.11.0 and typically releases on an annual cadence, often in sync with other Dask ecosystem projects, with bug fix releases as needed.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a Dask Array from a dummy NumPy array (simulating a large image) and perform a basic Dask computation (calculating the mean intensity). For actual image files, `dask_image.imread.imread` is used. Note that many `dask-image` functions leverage underlying libraries like scikit-image, which might need to be installed separately for full functionality (e.g., `pip install 'dask-image[complete]'`).

import dask.array as da
import dask_image.imread
import numpy as np

# Simulate loading a large image (e.g., a multi-gigabyte TIFF file)
# In a real scenario, you'd use: image_dask = dask_image.imread.imread('path/to/your/large_image.tif')
# For quickstart, create a dummy Dask array:
dummy_data = np.random.rand(2000, 2000, 3).astype(np.float32)
image_dask = da.from_array(dummy_data, chunks=(512, 512, 3))

print(f"Dask Array shape: {image_dask.shape}")
print(f"Dask Array chunks: {image_dask.chunks}")

# Perform a simple Dask computation (e.g., calculate the mean intensity)
mean_intensity = image_dask.mean().compute()
print(f"Mean intensity of the image: {mean_intensity:.4f}")

# Example using a filter (requires 'dask-image[complete]' for scikit-image)
# from dask_image.ndfilters import gaussian_filter
# filtered_image_dask = gaussian_filter(image_dask, sigma=1)
# print(f"Filtered Dask Array shape: {filtered_image_dask.shape}")
# print(f"Filtered image mean: {filtered_image_dask.mean().compute():.4f}")

view raw JSON →