Metadata-Version: 2.4
Name: pyxelart-detector
Version: 0.1.2
Summary: A library to detect if an image is likely pixel art.
Project-URL: Repository, https://github.com/dann-merlin/pyxelart-detector
Project-URL: Issues, https://github.com/dann-merlin/pyxelart-detector/issues
Author-email: Merlin Sievers <merlin.sievers@posteo.net>
License: AGPL-3.0-or-later
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.13
Requires-Dist: matplotlib>=3.10.0
Requires-Dist: mpl-interactions>=0.24.2
Requires-Dist: pillow>=11.1.0
Requires-Dist: pyqt6>=6.8.1
Requires-Dist: scikit-image>=0.25.1
Requires-Dist: scipy>=1.15.2
Requires-Dist: termcolor>=2.5.0
Description-Content-Type: text/markdown

# PyxelArt Detector

PyxelArt Detector is a Python library for analyzing images to determine if they qualify as pixel art.

```bash
$ python3 -m pyxelart_detector ./example.png
True
```

## Features

- **Accurate Detection**: Uses FFT-based transformations and a tailored cross-kernel approach to identify pixel art. Reach out via the [issues](https://github.com/dann-merlin/pyxelart-detector), if you think the library misclassified an image.
- **Simple API**: I don't like "complicated", so here you go:
  - `is_pixel_art(filepath: Path) -> bool`
  - `is_pixel_art_numpy(image: np.ndarray) -> bool`

## Installation

Install via uv/pip:

```bash
uv add pyxelart-detector
# or
pip install pyxelart-detector
```

## Usage

After installation, import and use the library in your projects as follows:

```python
from pyxelart_detector import is_pixel_art, is_pixel_art_numpy

# Example using the file-based API
result = is_pixel_art("path/to/your/image.png")
if result:
    print("This is pixel art!")
else:
    print("Not pixel art.")

# Example using the NumPy-based API
import matplotlib.pyplot as plt
image = plt.imread("path/to/your/image.png")
if is_pixel_art_numpy(image):
    print("This is pixel art!")
else:
    print("Not pixel art.")
```

## Contributing

Contributions are welcome! If you have ideas or improvements, please open an issue or submit a pull request on [GitHub](https://github.com/dann-merlin/pyxelart-detector).

## Acknowledgments

This library is built on excellent open-source tools,
including [NumPy](https://numpy.org/), [Matplotlib](https://matplotlib.org/),
and others.
