skillfed

openslide-python

Python interface to OpenSlide

openslide-python v1.4.6 270.4K downloads/30d#8,236 on PyPI432
Copyleft license LGPL-2.1-only AND BSD-3-Clause AND MIT AND LicenseRef-Public-Domain Active released

What it is and what it does

OpenSlide Python wraps the OpenSlide C library to read whole-slide images—the massive, multi-resolution medical images used in digital pathology. These images can occupy tens of gigabytes uncompressed and come in proprietary formats from vendors like Aperio, Hamamatsu, Leica, Philips, Zeiss, and others; standard image tools cannot handle them. The library lets you read image data at the resolution closest to a desired zoom level without loading the entire file into RAM.

The package depends on Pillow for image handling and requires Python ≥3.10 and a separate OpenSlide C library installation (≥3.4.0). It supports formats including Aperio, ARGOS, DICOM, Hamamatsu, Huron, Leica, MIRAX, Philips, Sakura, Trestle, Ventana, Zeiss, and generic tiled TIFF, and is actively maintained with wheels for modern Python versions and multiple architectures.

Use it for:

  • Load and tile whole-slide images for web-based pathology viewers or deep-learning training pipelines
  • Extract regions of interest at specific zoom levels from gigabyte-scale slides in vendor formats
  • Build automated image analysis workflows that process whole-slide images without memory exhaustion
  • Integrate multi-resolution slide access into clinical decision-support or research annotation tools
  • Work with DICOM or CZI slides in medical imaging applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

OpenSlide Python provides a Python interface to read whole-slide images (virtual slides) used in digital pathology, supporting multiple vendor formats and efficient multi-resolution access to gigabyte-scale images.

Yes, if you work with whole-slide images in digital pathology or medical research. The package is actively maintained, well-supported across platforms and Python versions, and solves a specialized but critical problem—standard image libraries cannot handle these formats or their scale. The main gotcha is the separate OpenSlide C library dependency. No known vulnerabilities.

Install

openslide-python on PyPI

pip

pip install openslide-python

uv

uv add openslide-python

poetry

poetry add openslide-python

Installing openslide-python

Before you install

Medium install friction due to a compiled C dependency (OpenSlide library) that must be installed separately. The project is actively maintained with recent releases, and wheels are provided for multiple Python versions and platforms (macOS, Linux, Windows, including aarch64).

License in practice

Licensed under LGPL-2.1-only with additional BSD-3-Clause, MIT, and public domain components. The copyleft LGPL treatment means derivative works must be licensed compatibly, though linking from a proprietary application is generally permitted if OpenSlide is dynamically linked.

Quickstart

pip install openslide-python

from openslide import OpenSlide

slide = OpenSlide('path/to/slide.svs')
region = slide.read_region((x, y), level, (width, height))

OpenSlide C library (≥3.4.0) must be installed separately; installation method varies by platform.

Verify before relying

  • Whether the OpenSlide C library (≥3.4.0) is pre-installed on target systems or must be managed separately in deployment
  • Performance characteristics and memory efficiency when handling specific gigabyte-scale slide formats in production
  • Recommended installation method for the separate OpenSlide C library dependency on different platforms

Package facts

License LGPL-2.1-only AND BSD-3-Clause AND MIT AND LicenseRef-Public-Domain (copyleft)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — Pillow
Maintenance actively maintained — 67 days since the last release
Last repo commit
First released
Downloads 270,441/month — #8,236 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openslide_python-1.4.6-cp310-cp310-macosx_10_9_universal2.whl; openslide_python-1.4.6-cp310-cp310-manylinux1_x86_64.manylinux_2_5_x86_64.whl; openslide_python-1.4.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; openslide_python-1.4.6-cp310-cp310-win_amd64.whl; openslide_python-1.4.6-cp311-abi3-macosx_10_9_universal2.whl; openslide_python-1.4.6-cp311-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl; openslide_python-1.4.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; openslide_python-1.4.6-cp311-abi3-win_amd64.whl; openslide_python-1.4.6-cp313-cp313t-macosx_10_13_universal2.whl; openslide_python-1.4.6-cp313-cp313t-manylinux1_x86_64.manylinux_2_5_x86_64.whl; openslide_python-1.4.6-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; openslide_python-1.4.6-cp313-cp313t-win_amd64.whl; openslide_python-1.4.6-cp314-cp314t-macosx_10_15_universal2.whl; openslide_python-1.4.6-cp314-cp314t-manylinux1_x86_64.manylinux_2_5_x86_64.whl; openslide_python-1.4.6-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; openslide_python-1.4.6-cp314-cp314t-win_amd64.whl

Keywords: OpenSlide, whole-slide image, virtual slide, library

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Healthcare IndustryIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 2 - BetaTopic :: Scientific/Engineering :: Bio-InformaticsTyping :: Typed

Tags

whole-slide image readervirtual slide python librarydigital pathology image processinghigh-resolution medical image accessmulti-resolution slide vieweraperio svs tiff readerpathology image format support
medical-imagingpathologywhole-slide-images

More Bio-Informatics packages