This commit is contained in:
jeremygan2021
2026-03-03 23:40:33 +08:00
parent f0d44b7290
commit 415cc9df97
6 changed files with 228 additions and 60 deletions

View File

@@ -684,9 +684,9 @@ def generate_image(prompt, progress_callback=None, retry_count=0, max_retries=2)
b5 = (b >> 3) & 0x1F
# Pack as Big Endian (>H) which is standard for SPI displays
# BGR565: Blue(5) Green(6) Red(5)
bgr565 = (b5 << 11) | (g6 << 5) | r5
rgb565_data.extend(struct.pack('>H', bgr565))
# RGB565: Red(5) Green(6) Blue(5)
rgb565 = (r5 << 11) | (g6 << 5) | b5
rgb565_data.extend(struct.pack('>H', rgb565))
# 保存为.bin文件
with open(GENERATED_THUMB_FILE, 'wb') as f: