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.2.tar.gz (20.0 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.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyxelart_detector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4bb12f33ad3b17b545e45d07b0e6ba8c81d2477bedc7bd68385733656e2b01d9
MD5 9c327fb1a4ae5948a369ec368ccf0b4f
BLAKE2b-256 7ba1309db9d253714316a9679e7872c176287e301ba37688c7bab6b59f501b18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyxelart_detector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 632d543c5d825498f62129bb44dfdbf188bc09d25ca2e58d985a523d54649f4c
MD5 28ee3607e3c45efb73f03873393c5946
BLAKE2b-256 022162599f847de3dedc96107211b8e7cec79c05a1cd98d94747a783c70d69ab

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