Skip to main content

A library to detect if an image is likely pixel art.

Project description

PyxelArt Detector

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

$ 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, 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:

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

Usage

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

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.

Acknowledgments

This library is built on excellent open-source tools, including NumPy, Matplotlib, and others.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxelart_detector-0.1.3.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxelart_detector-0.1.3-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file pyxelart_detector-0.1.3.tar.gz.

File metadata

  • Download URL: pyxelart_detector-0.1.3.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for pyxelart_detector-0.1.3.tar.gz
Algorithm Hash digest
SHA256 640e2d9a166fa92ac65088a8ecce2a5a1f7d43b55005d7ab82fc9abb9429e1da
MD5 e783456759de6b8969d2f686aed94c2f
BLAKE2b-256 341617b5a006467082e691ccb3bbf3c5ef6f1ab05aa5e71af479fa9d7cbdc470

See more details on using hashes here.

File details

Details for the file pyxelart_detector-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pyxelart_detector-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 85e6e868e9fc83deaa9cd1bf8ab12f2f60c367d70121a0f27c56a7d514937e56
MD5 fee95c3e64fbda115c11b4a4258d39f4
BLAKE2b-256 ac0cfe79902a4de74eb52cbacc0471150d00feb4bcf176ea8113421d28b2f457

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page