Metadata-Version: 2.5
Name: gradio_tiff
Version: 0.2.0
Summary: Custom Gradio component for multi-page TIFF images
Project-URL: repository, https://github.com/NiklasvonM/Gradio-TIFF/
Author-email: Niklas von Moers <niklasvmoers@protonmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: gradio-custom-component,gradio-template-ImageSlider
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: <4,>=3.10
Requires-Dist: gradio<7.0,>=6.9
Description-Content-Type: text/markdown

# gradio_tiff

[![PyPI - Version](https://img.shields.io/pypi/v/gradio_tiff)](https://pypi.org/project/gradio_tiff/)

A custom [Gradio](https://gradio.app) component that displays multi-page TIFF images.

![Demo screenshot](docs/screenshot.png)

## Install

```bash
pip install gradio_tiff
```

## Quick start

```python
import gradio as gr
from gradio_tiff import Tiff


def echo(path: str | None) -> str | None:
    return path


demo = gr.Interface(
    fn=echo,
    inputs=Tiff(value=Tiff().example_value(), label="Upload TIFF"),
    outputs=Tiff(label="Echoed TIFF"),
)

if __name__ == "__main__":
    demo.launch()
```

The component:

- accepts `.tif` / `.tiff` uploads (single file),
- renders each page as a PNG canvas and shows page navigation if the file is multi-page,
- exposes the local file path to your Python function via `preprocess`,
- packages a return value (path or URL) as a `FileData` payload via `postprocess`,
- emits `upload`, `change` and `clear` events.

## API reference

See [DOCS.md](DOCS.md) for the full auto-generated reference.
