https://github.com/zeynepcol/pixel-matrix-converter
Extracts pixel data from images and converts it into array with RGB values and intensity mapping.
https://github.com/zeynepcol/pixel-matrix-converter
image-processing pixel-art python rgb
Last synced: about 1 year ago
JSON representation
Extracts pixel data from images and converts it into array with RGB values and intensity mapping.
- Host: GitHub
- URL: https://github.com/zeynepcol/pixel-matrix-converter
- Owner: zeynepcol
- Created: 2024-10-27T11:25:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-01T14:22:18.000Z (over 1 year ago)
- Last Synced: 2025-02-09T17:14:19.966Z (over 1 year ago)
- Topics: image-processing, pixel-art, python, rgb
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Image Pixel Data Extraction Script
This project uses **Python's PIL (Pillow)** library to load, process, and extract pixel data from an image file. The program iterates over each pixel, computes an "intensity" value, and outputs pixel data in a format suitable for C++ array use, making it ideal for projects that involve image analysis or pixel-based graphical effects.
FEATURES
**1. Image Loading**
Opens an image file using **PIL.Image**.
**2. Image Resizing**
Optionally resizes the image to specified dimensions (default: 50x50 pixels).
**3. RGB Conversion**
Converts the image to RGB mode, ensuring compatibility with RGB-based calculations.
**4. Intensity Calculation**
Computes pixel intensity based on the average RGB values.
**5. C++ Array Output**
Outputs the pixel data in a C++ compatible array format for easy integration.
Requirements
**Python 3.6+**
**Pillow library (pip install pillow)**