Metadata-Version: 2.4
Name: image-video-utils
Version: 1.0.0
Summary: Image and video utils...
Keywords: frames,image,metadata,video
Author: Nicolas MAIGNAN
Author-email: Nicolas MAIGNAN <nicolas.maignan@univ-lorraine.fr>
License-Expression: MIT
License-File: LICENSE
Requires-Dist: av>=14.4.0,<18.0.0
Requires-Dist: beartype>=0.22.9,<1.0.0
Requires-Dist: imageio>=2.37.2,<3.0.0
Requires-Dist: jaxtyping>=0.3.9,<1.0.0
Requires-Dist: rich>=14.2.0,<16.0.0
Requires-Dist: scikit-image>=0.25.2,<1.0.0
Requires-Dist: typer>=0.20.0,<1.0.0
Requires-Python: >=3.11
Project-URL: documentation, https://image-video-utils-cf9507.gitlabpages.inria.fr
Project-URL: repository, https://gitlab.inria.fr/anr-arce/utils/image-video-utils
Description-Content-Type: text/markdown

# Image & Video Utils

[![Python badge](https://img.shields.io/badge/Python-3.11+-0066cc?style=for-the-badge&logo=python&logoColor=yellow)](https://www.python.org/downloads/)
[![MIT License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge&)](https://spdx.org/licenses/MIT.html)

[![uv badge](https://img.shields.io/badge/Packager-uv-dd5fe8?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iNDEiIGhlaWdodD0iNDEiIHZpZXdCb3g9IjAgMCA0MSA0MSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTS01LjI4NjE5ZS0wNiAwLjE2ODYyOUwwLjA4NDMwOTggMjAuMTY4NUwwLjE1MTc2MiAzNi4xNjgzQzAuMTYxMDc1IDM4LjM3NzQgMS45NTk0NyA0MC4xNjA3IDQuMTY4NTkgNDAuMTUxNEwyMC4xNjg0IDQwLjA4NEwzMC4xNjg0IDQwLjA0MThMMzEuMTg1MiA0MC4wMzc1QzMzLjM4NzcgNDAuMDI4MiAzNS4xNjgzIDM4LjIwMjYgMzUuMTY4MyAzNlYzNkwzNy4wMDAzIDM2TDM3LjAwMDMgMzkuOTk5Mkw0MC4xNjgzIDM5Ljk5OTZMMzkuOTk5NiAtOS45NDY1M2UtMDdMMjEuNTk5OCAwLjA3NzU2ODlMMjEuNjc3NCAxNi4wMTg1TDIxLjY3NzQgMjUuOTk5OEwyMC4wNzc0IDI1Ljk5OThMMTguMzk5OCAyNS45OTk4TDE4LjQ3NzQgMTYuMDMyTDE4LjM5OTggMC4wOTEwNTkzTC01LjI4NjE5ZS0wNiAwLjE2ODYyOVoiIGZpbGw9IiNERTVGRTkiLz4KPC9zdmc+Cg==)](https://docs.astral.sh/uv/)
[![Ruff badge](https://img.shields.io/badge/Linter_&_Formatter-Ruff-d6ff64?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5SdWZmPC90aXRsZT48cGF0aCBkPSJNMzUwIDE2OS45NzFjMC0xMS4wMy04Ljk0MS0xOS45NzEtMTkuOTcxLTE5Ljk3MUgxNTB2MjAwaDkydi02MGgxNnY2MGg5MnYtNzZoLTQwdi0xNmgyMC4wMjljMTEuMDMgMCAxOS45NzEtOC45NDEgMTkuOTcxLTE5Ljk3MXYtNjguMDU4Wk0yNzQgMjI2djE2aC00OHYtMTZoNDhaIiBzdHlsZT0iZmlsbDojZDdmZjY0IiB0cmFuc2Zvcm09Im1hdHJpeCguNSAwIDAgLjUgLTc1IC03NSkiLz48L3N2Zz4=)](https://docs.astral.sh/ruff/)
[![ty badge](https://img.shields.io/badge/Type_checker-ty-48eae0?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQ4IDcuNjhIMjcuODRWMEgzLjg0VjcuNjhIMFYyNS45MkgzLjg0VjQwLjIxMzZDMy44NCA0NC41MTM5IDcuMzI2MDcgNDggMTEuNjI2NCA0OEg0OFYyOS43NkgyNy44NFYyNS45Mkg0MC4yMTM2QzQ0LjUxMzkgMjUuOTIgNDggMjIuNDMzOSA0OCAxOC4xMzM2VjcuNjhaIiBmaWxsPSIjNDZFQkUxIi8+Cjwvc3ZnPgo=)](https://docs.astral.sh/ty/)
[![bear-ified](https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg)](https://beartype.readthedocs.io)

This repository provides a Python module for interacting with image and video files using sensible defaults and clear, consistent interfaces.

## ✨ Features

- An `ImageResolution` class to represent the resolution of images or video frames.
- A `reshape` function to resize images easily.
- A `VideoMetadata` class to read video information such as the number of frames, frame rate, or codec.
- Multiple functions to read and write videos as NumPy arrays, image files, or video files.
- A simple CLI to extract frames or encode videos.

## 📦 Installation

### The module

You can install `image_video_utils` directly from source using `pip`:

```bash
pip install git+https://gitlab.inria.fr/nmaignan/image-video-utils.git
```

You can also use another Python package manager such as `uv`:

```bash
uv add git+https://gitlab.inria.fr/nmaignan/image-video-utils.git
```

### The CLI

You can install the CLI tool with [**`pipx`**](https://pipx.pypa.io/stable/) or [**`uv`**](https://docs.astral.sh/uv/):

```bash
uv tool install git+https://gitlab.inria.fr/nmaignan/image-video-utils
```

## 🧪 Usage

### The module

Import the required utilities in your Python code:

```python
from image_video_utils.video import write_video_from_iterable
```

### The CLI

The CLI is available via:

```bash
ivutils --help
```

## 📚 Documentation

The documentation is generated using [**`pdoc`**](https://pdoc.dev/) and is available as a [GitLab Page](https://image-video-utils-cf9507.gitlabpages.inria.fr/).
