A package for processing images and generating Verilog code for FPGA
Project description
Picture2Pixel
By: Chen Guoyi; Fang Sihan. National University of Singapore.
Picture2Pixel is an open-source Python library designed to transform images into pixel art that can be displayed on FPGA-driven OLED screens. By employing advanced computer graphics techniques, this library preprocesses images to minimize distortion during the pixelation process. The resulting artwork is expressed as combinations of predicate logic in Verilog language, ensuring compatibility with FPGA technology. This optimization not only enhances display efficiency on OLED screens but also reduces energy consumption, making it ideal for developers looking to integrate low-power, high-efficiency visual displays into their hardware projects.
For more information about this project, please nevigate to project homepage: https://www.comp.nus.edu.sg/~guoyi/project/picture2pixel/
Table of Contents
Installation
Install the picture2pixel
package using pip:
pip install picture2pixel
Usage
Convert Image to Pixel Data
Convert an image to pixel data and generate Verilog code:
python -m picture2pixel.convert2pixel <image_url> <width> <height> <svd_r> <output_dir>
Example:
python -m picture2pixel.convert2pixel https://www.comp.nus.edu.sg/~guoyi/project/picture2pixel/default.png 96 64 20 output_directory
Convert Pixel Data to Image
Convert pixel data from a .p2p
file back into an image:
python -m picture2pixel.convert2picture <p2p_file> <width> <height> <output_dir>
Example:
python -m picture2pixel.convert2picture https://www.comp.nus.edu.sg/~guoyi/project/picture2pixel/default.p2p 96 64 output_directory
Project Structure
picture2pixel/
├── __init__.py
├── convert2pixel.py
├── convert2picture.py
├── image_processing.py
├── verilog_generator.py
├── tests/
│ ├── __init__.py
│ ├── test_picture2pixel.py
│ ├── test_pixel2picture.py
│ ├── test_integrated.py
README.md
requirements.txt
setup.py
License
Copyright (c) <2024> <copyright Chen Guoyi, Fang Sihan>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file picture2pixel-0.2.0.tar.gz
.
File metadata
- Download URL: picture2pixel-0.2.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a61eb8ebdc95d0a60b96cf2f1918404582dadaf006267cc6c0a913dad27c66a |
|
MD5 | 3b98947d9566dc495e8a7ca43a3c00f5 |
|
BLAKE2b-256 | 65270af5d5831309686267e6d636c98245614411176c3ff70be2318f5820d5fd |
File details
Details for the file picture2pixel-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: picture2pixel-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da06387f95220d2e3b9a10646cf29b2d96da185e47bab50c8380c90ed1cc6a6b |
|
MD5 | d582dabb20e4850777e8d288373c84bc |
|
BLAKE2b-256 | a29bb281d06f59eed6f653ab2b696b4eaa3011aa83fd362b54423ea30dad048a |