Skip to main content

Experiment with image filter workflows, by superpositions.

Project description

Pixelist 🎨

PyPI version Python 3.8+ License: MIT

A powerful, composable image processing pipeline library for Python that makes working with image filters fun and flexible! 🚀

✨ Features

  • 🔄 Sequential and parallel image processing pipelines
  • 🎯 Easy-to-use filter composition
  • 📊 Built-in visualization support
  • 🛡️ Type-safe with Pydantic validation
  • 🎨 Support for both grayscale and color images
  • 📝 Comprehensive processing history tracking

🚀 Installation

# Basic installation
pip install pixelist

# With visualization support
pip install pixelist[display]

🎯 Quick Start

Here's a simple example to get you started:

from pixelist import ImagePipeline, Filter, ProcessingMode
import numpy as np

# Define some filters
@Filter.make
def threshold(image: np.ndarray) -> np.ndarray:
    return np.where(image > 127, 255, 0)

@Filter.make
def blur(image: np.ndarray) -> np.ndarray:
    return cv2.GaussianBlur(image, (5, 5), 0)

# Create and run a pipeline
pipeline = ImagePipeline([blur, threshold])
results = pipeline.run(
    images=your_image,
    mode=ProcessingMode.WITH_INTERMEDIATE_SHOW_ALL
)

🌟 Advanced Usage

Parallel Processing

If you want to experiment with two probable fits in your workflow, make a parallel workflow between those two! Sequential steps after that parallel step would also run on all previous branches without joining the branches. There might be parallel join, or sql like syntax later on for a fine-grain control on batches, but for now, its as simple as that!

# Create parallel branches in your pipeline
pipeline = ImagePipeline([
    histogram_stretch,
    (prewitt_filter, laplacian_filter)  # Parallel filters
])

Custom Filter Creation

@Filter.make
def my_awesome_filter(image: np.ndarray) -> np.ndarray:
    # Your image processing magic here
    return processed_image

🎨 Visualization

The library includes built-in visualization support:

from pixelist import ImagePipeline, ProcessingMode

pipeline.make(
    images=input_images, # can be a random sample of your dataset
    filters=[
        histogram_stretch # Sequential
        (prewitt_filter, laplacian_filter) # Superposition/Parallel, follows to parallel branches
    ]
    mode=ProcessingMode.WITH_INTERMEDIATE_SHOW_ALL  # Shows and store all intermediate steps,
)

Output Diagram

🛠️ Processing Modes

  • NO_INTERMEDIATE: Just the final result
  • NO_INTERMEDIATE_SHOW_FINAL: Show final result visually
  • WITH_INTERMEDIATE: Keep all intermediate results
  • WITH_INTERMEDIATE_SHOW_ALL: Visual display of all steps
  • WITH_INTERMEDIATE_SHOW_FINAL: Keep all, show final

Final Images are Orange (Leafs of Workflow)

Workflow Diagram

🤝 Contributing

Contributions are welcome! Feel free to:

  • Open issues
  • Submit PRs
  • Suggest improvements
  • Share the love ❤️

📝 License

MIT License - feel free to use in your projects!

🙏 Acknowledgments

Special thanks to:

  • The NumPy and OpenCV communities
  • All our contributors

Made with ❤️ by the AARMN The Limitless

Remember to ⭐ the repo if you like it!

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

pixelist-0.2.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

pixelist-0.2.3-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file pixelist-0.2.3.tar.gz.

File metadata

  • Download URL: pixelist-0.2.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for pixelist-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a814252ea42554403635bc52317a83f518c7ad4796760e093e74160da5bf7242
MD5 951e9749598664219190dff9b675d785
BLAKE2b-256 4357c9e75fbd3011e0050c1bebe6e2f6b284c9ddaf337d328e0aa72cbcf27cf9

See more details on using hashes here.

File details

Details for the file pixelist-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pixelist-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for pixelist-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 74514f2e03c01c86aa17c4089152950d1010a005db40e33acdba11305c334439
MD5 7ce928c2e77d4b93bc9a4ab653cbee63
BLAKE2b-256 73dd77d692f2c9f9a3c2e2137a3559f930ee785ae0755c4daf4376b38ec23ea4

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