Skip to main content

BIPL is a Big Image Python Library

Library to read big pyramidal images like in formats like BigTiff, Aperio SVS, Leica MRXS.

bipl.Slide - ndarray-like reader for multiscale images (svs, tiff, etc...)

import numpy as np
from bipl import Slide

slide = Slide.open('test.svs')
shape: tuple[int, ...] = slide.shape  # Native shape
downsamples: tuple[int, ...] = slide.downsamples  # List of pre-existing sub-resolution levels

# Get native miniature
tmb: np.ndarray = slide.thumbnail()

mpp: float = slide.mpp  # X um per pixel, native resolution
image: np.ndarray = slide[:2048, :2048]  # Get numpy.ndarray of 2048x2048 from full resolution

MPP = 16.  # Let's say we want slide at 16 um/px resolution
downsample = MPP / slide.mpp
mini = slide.pool(downsample)  # Gives `downsample`-times smaller image
mini = slide.resample(MPP)  # Gives the same result

# Those ones trigger ndarray conversion
image: np.ndarray
image = mini[:512, :512]  # Take a part of
image = mini.numpy()  # Take a whole resolution level
image = np.array(mini, copy=False)  # Use __array__ API

bipl.Mosaic - apply function for each tile of big image on desired scale.

import numpy as np
from bipl import Mosaic, Slide

m = Mosaic(step=512, overlap=0)  # Read at [0:512], [512:1024], ...

# Open slide at 1:1 scale
s = Slide.open('test.svs')

# Target at 4 um/px resolution
# If `test.svs` has some pyramid in it (i.e. 1:1, 1:4, 1:16), it will be used to speed up reads.
s4 = s.resample(mpp=4.0)

# Get iterator over tiles.
# Reads will be at [0:512], [512:1024] ... @ MPP
tiles = m.iterate(s4)

# Read only subset of tiles according to binary mask (1s are read, 0s are not).
# `s4.shape * scale = mask.shape`, `scale <= 1`
tiles = tiles.select(mask, scale)

# Read all data, trigger I/O. All the previous calls do not trigger any disk reads beyond metadata.
images: list[np.ndarray] = [*tiles]

Installation

pip install bipl

BIPL is compatible with: Python 3.13+. Tested on Ubuntu & Windows.

DeepZoom server

To start use:

pip install bipl[deepzoom]
export SLIDES=~/slides
uvicorn bipl.dzi:app --workers 4 --host 0.0.0.0 --port 8000

Or you can just use a router from there:

from bipl.dzi import router

your_fastapi_app.include_router(router)

Metadata

Release files for bipl 0.7.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bipl 0.7.7
File Size Uploaded
bipl-0.7.7.tar.gz 47.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bipl 0.7.7
File Interpreter ABI Platform
bipl-0.7.7-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details

Total release size: 3.9 MB

Release files / bipl-0.7.7.tar.gz

Download URL bipl-0.7.7.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
982328c0efcb134a2b9b36621350651eced09005abd13680cece45f0a2e18a96
BLAKE2b-256 checksum
How to use checksums
fe2e5f6914d0ce6e6ef9d0c31c71fd83ec8f27cee72f28fedc0594586f056726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release files / bipl-0.7.7-py3-none-win_amd64.whl

Download URL bipl-0.7.7-py3-none-win_amd64.whl
Size 3.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
163dacf091254cf9356bebf9a218886e36f8f30d6330265415ce21d2f1cfd339
BLAKE2b-256 checksum
How to use checksums
176655f9fc4fa8adbdfacd704cd258ea99c9b35d28f8f10c524d7a51242035b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.7 This release

2 release files

0.6.16

1 release file

0.6.6

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.3.9

2 release files

0.2.4

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page