An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

# oledimg

![Test CI](https://github.com/nthnn/oledimg/actions/workflows/test.yml/badge.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/nthnn/oledimg?logo=git&label=Repository%20Size)
[![GitHub Stars](https://img.shields.io/github/stars/nthnn/QLBase.svg)](https://github.com/nthnn/QLBase/stargazers)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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/oledimg

static 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.