# Pivimage

![Tests](https://github.com/matthiasprobst/pivimage/actions/workflows/tests.yml/badge.svg)
[![codecov](https://codecov.io/github/matthiasprobst/pivimage/graph/badge.svg?token=7H1BZ7NM1T)](https://codecov.io/github/matthiasprobst/pivimage)

`pivimage` is a lightweight Python library for Particle Image Velocimetry (PIV) image handling during pre-processing.
It focuses on practical operations you usually need before correlation or analysis.

## What It Provides

- image loading for common formats (including `.b16`)
- helpers for single-frame and double-frame PIV recordings
- common image transforms (`normalize`, `rot90`, `rot180`, `flip*`, masking)
- quick plotting utilities for images and histograms

## Installation

```bash
pip install pivimage
```

## Quick Start

```python
import pivimage

img = pivimage.PIVImage("frame_0001.tif")
img_norm = img.normalize()
img_rot = img_norm.rot90()

pair = pivimage.PIVImagePair("frame_a.tif", "frame_b.tif")
pair.plot()
```

## Example Notebook

<a target="_blank" href="https://colab.research.google.com/github/matthiasprobst/pivimage/blob/main/examples/Getting%20started.ipynb">
  <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>

## Development and Tests

```bash
pip install -r requirements-dev.txt
pytest
pytest --cov --cov-report=html
```
