Skip to content

Commit 05d87ea

Browse files
committed
Enhance README and code structure for Pixel2CPP editor. Updated export formats to include RGB24, RGB332, and 4-bit grayscale. Improved usage instructions and added new features in the UI. Refactored packing functions into separate modules for better organization and maintainability.
1 parent fe24536 commit 05d87ea

File tree

7 files changed

+797
-608
lines changed

7 files changed

+797
-608
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
A browser-based pixel editor that exports Arduino-ready C++ code. Create pixel art and get optimized code for:
44

55
- **1-bit packed bytes** for SSD1306 OLED displays (Adafruit_GFX drawBitmap)
6-
- **RGB565 16-bit values** for color TFT displays (ILI9341/ST7735/etc.)
6+
- **RGB565 16-bit values** for color TFT displays (ST7735/ILI9341/etc.)
7+
- **RGB24 24-bit values** for ESP32/high-memory color displays
8+
- **RGB332 8-bit values** for low-memory color displays (SSD1331)
9+
- **4-bit grayscale** for e-ink/EPD displays with 16 gray levels
710

811
## Features
912

@@ -32,23 +35,42 @@ A browser-based pixel editor that exports Arduino-ready C++ code. Create pixel a
3235
## Usage
3336

3437
1. **Set canvas size** - Choose dimensions suitable for your display
35-
2. **Select mode** - 1-bit for OLED, RGB565 for color TFT
38+
2. **Select format** - Choose from 1-bit OLED, RGB565 TFT, RGB24, RGB332, or 4-bit grayscale
3639
3. **Draw your sprite** - Use pen, erase, fill, or eyedropper tools
37-
4. **Export** - Click "Export .h" to download Arduino-ready header file
38-
5. **Test** - Run built-in tests to validate packing logic
40+
4. **Generate code** - Click "Generate Code" to see complete Arduino setup
41+
5. **Export** - Click "Export .h" to download Arduino-ready header file
42+
6. **Test** - Run built-in tests to validate all format conversions
3943

4044
## Export Formats
4145

42-
### 1-bit (OLED/SSD1306)
46+
### 1-bit (SSD1306 OLED)
4347
```cpp
4448
const uint8_t sprite_bits[] PROGMEM = { 0xAA, 0x55, ... };
4549
display.drawBitmap(x, y, sprite_bits, width, height, 1);
4650
```
4751
48-
### RGB565 (TFT/ILI9341)
52+
### RGB565 (ST7735/ILI9341 TFT)
4953
```cpp
5054
const uint16_t sprite_pixels[] PROGMEM = { 0xF800, 0x07E0, ... };
51-
// Use with tft.setAddrWindow() and tft.writePixel()
55+
// Complete setup with tft.setAddrWindow() and fast pixel writing
56+
```
57+
58+
### RGB24 (ESP32/High Memory)
59+
```cpp
60+
const uint8_t sprite_pixels[] PROGMEM = { 0xFF, 0x00, 0x00, ... };
61+
// Full 24-bit color for high-quality displays
62+
```
63+
64+
### RGB332 (SSD1331/Low Memory)
65+
```cpp
66+
const uint8_t sprite_pixels[] PROGMEM = { 0xE0, 0x1C, 0x03, ... };
67+
// 8-bit color (3-3-2 bits for R-G-B)
68+
```
69+
70+
### 4-bit Grayscale (E-ink/EPD)
71+
```cpp
72+
const uint8_t sprite_pixels[] PROGMEM = { 0x0F, 0xA5, ... };
73+
// 16 grayscale levels, 2 pixels per byte
5274
```
5375
5476
## Development

0 commit comments

Comments
 (0)