https://github.com/nthnn/oledimg
Simple Python tool to convert image files to OLED array bitmaps for Arduino.
https://github.com/nthnn/oledimg
Last synced: 4 months ago
JSON representation
Simple Python tool to convert image files to OLED array bitmaps for Arduino.
- Host: GitHub
- URL: https://github.com/nthnn/oledimg
- Owner: nthnn
- License: mit
- Created: 2023-11-15T09:49:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-15T10:33:34.000Z (over 1 year ago)
- Last Synced: 2025-01-13T07:21:21.694Z (5 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oledimg


[](https://github.com/nthnn/QLBase/stargazers)
[](https://opensource.org/licenses/MIT)`oledimg` is a Python script designed to convert images into OLED display-compatible bitmap arrays. The resulting C/C++ file can be easily integrated into embedded systems, making it a handy tool for developers working with OLED displays.
## Prerequisites
Before using `oledimg`, ensure that you have Python installed on your system. `oledimg` is written in Python, and thus, a compatible Python version is required.
Moreover, you need to install all the required Python libraries by running the following command in your terminal:
```bash
pip install -r requirements.txt
```Make sure to execute this command in the same directory where the requirements.txt file is located. Now, you're ready to use oledimg to convert images to OLED-compatible bitmap arrays!
## Usage
```bash
python3 oledimg.py [image] [output]
```- **image**: The path to the input image file.
- **output**: The path to the output C/C++ file.### Example
```bash
python3 oledimg.py example.jpg oled_bitmap.h
```### Output
The generated C/C++ file contains a PROGMEM array representing the image in OLED-compatible bitmap format.
```c
// Generated by oledimg.py
// Check oledimg tool out at https://github.com/nthnn/oledimgstatic const uint8_t PROGMEM example = {
{0, 0, 0, ..., 1, 1, 0},
{0, 1, 0, ..., 0, 0, 1},
...
};
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.