pypi-shield license-shield python-version-shield build binder doi

Pyrtools is a python package for multi-scale image processing, adapted from Eero Simoncelli’s matlabPyrTools.

The tools include:
  • Recursive multi-scale image decompositions (pyramids), including Laplacian pyramids, QMFs, Wavelets, and steerable pyramids. These operate on 1D or 2D signals of arbitrary dimension.

  • Fast 2D convolution routines, with subsampling and boundary-handling.

  • Fast point-operations, histograms, histogram-matching.

  • Fast synthetic image generation: sine gratings, zone plates, fractals, etc.

  • Display routines for images and pyramids. These include several auto-scaling options, rounding to integer zoom factors to avoid resampling artifacts, and useful labeling (dimensions and gray-range).

NOTE: If you are only interested in the complex steerable pyramid, we have a pytorch implementation in the plenoptic package; the implementation in plenoptic is differentiable.

Citing us

If you use pyrtools in a published academic article or presentation, please cite us! You can find the link to the most recent release on Zenodo here (though please specify the version you used not the most recent one!). You can also get a formatted citation at the top right of our GitHub repo

Quick Start

On Linux or macOS, open a shell and run:

pip install pyrtools

More instructions available at Installation.

In the python interpreter, then call:

import pyrtools as pt

Create pyramid:

pyr = pt.pyramids.LaplacianPyramid(img)

Reconstruct image from pyramid:

recon_img = pyr.recon_pyr()

For more details, see the jupyter notebooks included in the TUTORIALS/ directory, static versions of which are linked in the navigation sidebar. You can play around with a live version of them in order to test out the code before downloading on binder

Pyramid resources

If you would like to learn more about pyramids and why they’re helpful for image processing, here are some resources to get you started: