Metadata-Version: 2.4
Name: trame-image-tools
Version: 0.0.2
Summary: A trame package to display, manipulate, and select regions in images.
Author: Alessandro Genova
License: Apache Software License
Keywords: Python,Interactive,Web,Application,Framework
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: trame_client>=3.5
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: codespell; extra == "dev"

# `trame-image-tools`

A set of [`trame`](https://github.com/kitware/trame) widgets to create a zoom and pan 2D image environment that includes interactive area selection widgets.

![demo_image](demo.png)

## Install
```bash
pip install trame-image-tools
```

## Usage
```python
from trame_image_tools.widgets import (
    TrameImage,
    TrameImageRoi,
    TrameImageLine,
    TrameImageCircle,
    TrameImagePolygon,
    TrameImageGrid,
)

with TrameImage(
    src="https://www.kitware.com/main/wp-content/uploads/2023/10/logo-trame.png",
    size=("size", [800, 210]),
):
    TrameImageGrid(
        spacing=("grid_spacing", [50, 25]),  # [x_tick_spacing, y_tick_spacing]
    )

    TrameImageLine(
        v_model=("line", [200, 50, 300, 150]),  # [x0, y0, x1, y1, ...]
    )

    TrameImageRoi(
        v_model=("roi", [350, 50, 100, 100]),  # [x, y, width, height]
    )

    TrameImageCircle(
        v_model=("circle", [550, 100, 50]),  # [x, y, radius]
    )

    TrameImagePolygon(
        v_model=("polygon", [650, 90, 670, 150, 730, 150, 750, 90, 700, 50]),  # [x0, y0, x1, y1, ...]
    )
```
