scikit-image
scikit-image is an open-source Python library for image processing and computer vision, built on NumPy, SciPy, and other core scientific Python projects. It provides a comprehensive collection of algorithms for tasks such as segmentation, filtering, transformation, feature detection, and analysis. The project is actively maintained, with frequent releases, and version 0.26.0 was released on 2025-12-20.
Warnings
- deprecated The binary versions of morphological operations (`binary_erosion`, `binary_dilation`, `binary_opening`, `binary_closing`) in `skimage.morphology` are deprecated in favor of their non-binary counterparts (`erosion`, `dilation`, `opening`, `closing`). The binary versions were not significantly faster and sometimes slower.
- deprecated Parameters `max_cost` and `max_cumulative_cost` in `skimage.graph.MCP.find_costs` are deprecated as they previously did nothing. A new parameter `max_step_cost` has been introduced.
- deprecated The `area_threshold` parameter in `skimage.morphology.remove_small_holes` is deprecated in favor of `max_size` for clearer API and behavior. `max_size` removes holes smaller than or equal to its value, while the previous parameter only removed strictly smaller ones.
- gotcha scikit-image 0.26.0 requires Python 3.11 or newer. Attempting to install with an older Python version will automatically resolve to an older, compatible `scikit-image` version, which may lack recent features and fixes.
Install
-
pip install scikit-image -
pip install scikit-image[data] -
pip install scikit-image[optional]
Imports
- skimage
import skimage as ski
- io
from skimage import io
- filters
from skimage import filters
Quickstart
import skimage as ski
# Load an example image (e.g., coins dataset)
image = ski.data.coins()
# Apply a basic image processing operation, e.g., Otsu thresholding
threshold_value = ski.filters.threshold_otsu(image)
binary_image = image > threshold_value
print(f"Original image shape: {image.shape}")
print(f"Calculated threshold value: {threshold_value}")
print(f"Processed (binary) image shape: {binary_image.shape}")