Metadata-Version: 2.1
Name: layout-visualizer
Version: 1.0.0
Summary: Easily draw layout BBoxes
Home-page: https://github.com/shunyooo/layout-visualizer
License: MIT
Author: Shunyo Kawamoto
Author-email: shunyo.kawamoto@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: pillow (>=10.2.0,<11.0.0)
Requires-Dist: pydantic (>=2.6.3,<3.0.0)
Project-URL: Repository, https://github.com/shunyooo/layout-visualizer
Description-Content-Type: text/markdown

# layout-visualizer

[![PyPI version](https://badge.fury.io/py/layout-visualizer.svg)](https://badge.fury.io/py/layout-visualizer) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)

Easily draw layout BBoxes



## Features

- Easily draw labeled BBoxes
  - Draw labels without overlap
- Low dependency
  - Only depends on `Pillow` and `Pydantic`



## Installation

```bash
pip install layout-visualizer
```



## Getting started

See [example notebook](./example.ipynb) for more details

```python
from layout_visualizer import draw_label_bboxes

image = ...  # Load PIL Image
label_bboxes = [
    ("Background Color", (0, 0, 1080, 1080)),
    ("BG Color", (0, 0, 1080, 1080)),
    ("Shadow", (0, 0, 1080, 1080)),
    ("Object 1", (138, 426, 942, 870)),
]
draw_label_bboxes(image, label_bboxes, font_size=20, line_width=5)
```

<img src="https://github.com/shunyooo/layout-visualizer/assets/17490886/6d79b894-405b-48fe-9661-5c672b2b5690" height=512/>

<sub>(Using psd from <a href="https://jp.freepik.com/free-psd/ramadan-mubarak-islamic-greetings-social-media-post-template_126726406.htm#&position=25&from_view=popular&uuid=7b635cda-4b7e-49a3-ba99-bc9537795d6f">Author: xvector</a> / Dictionary: Freepik)</sub>

