LCD Image Converter Settings: Best Formats, Resolutions, and Tips
Purpose & output types
- Goal: produce image data (bitmaps, arrays, or binary files) that match your display controller’s format so the MCU or driver can render pixels correctly.
- Common output types: raw byte arrays, C header files, BMP/PNG with indexed palettes, and vendor-specific formats (e.g., ST7735, SSD1306).
Formats to choose
- Monochrome (1-bit): for OLEDs and small e-paper displays. Use when memory and bandwidth are limited. Choose 1-bit vertical or horizontal byte packing to match controller expectations.
- Indexed palette (⁄8-bit): for low-color displays (16–256 colors). Reduces size while preserving more detail than 1-bit.
- RGB565 (16-bit): common for many TFT LCDs — good color fidelity vs memory. Use when controller expects 5-6-5 ordering.
- RGB888 (24-bit): full color, used when memory/bandwidth aren’t constrained or for intermediate processing.
- Packed formats (e.g., BGR, little-endian): match your controller/endian requirements precisely.
Resolution & scaling
- Match the display native resolution whenever possible to avoid extra scaling and alignment issues.
- Scale down with aspect-lock to avoid stretching; pad with background color if needed.
- Avoid non-integer downscaling (e.g., 1000→333 px) when possible — it can introduce artifacts; prefer integer factors or apply high-quality resampling.
- Crop for performance-critical UI elements (icons, fonts) rather than resizing entire images.
Color conversion & palettes
- Dither when reducing color depth (Floyd–Steinberg or ordered) to preserve perceived detail.
- Choose a fixed palette for UI consistency (e.g., system colors) or adaptive palette for photo-like images.
- Gamma correction: apply gamma-aware conversion when mapping 24-bit→16-bit to avoid washed-out midtones.
Byte order, packing & orientation
- Byte packing: select vertical vs horizontal byte orientation based on controller docs (e.g., SSD1306 uses vertical pages).
- Endianness: ensure the generated byte order matches MCU read/write expectations.
- Mirroring/rotation: apply at conversion time to avoid runtime CPU cost when display wiring or driver expects rotated data.
Compression & memory
- Use run-length encoding (RLE) for simple graphics with large flat areas (icons, GUIs).
- Use LZ4 or zlib for larger photographic assets if your loader supports decompression.
- Tile-based storage: split large images into tiles/blocks that map to VRAM or flash pages for partial updates.
Output file & code options
- C/C++ headers: commonly used for embedded — choose static const arrays with PROGMEM when using microcontrollers with separate flash.
- Byte alignment & padding: align rows to ⁄64-bit boundaries if DMA or hardware requires it.
- Include metadata: width, height, format type, and bytes-per-row constants in generated files for easier integration.
Quality vs performance trade-offs
- Memory-limited devices: prefer 1-bit or 4-bit indexed + RLE; pre-scale and crop assets.
- Performance-sensitive updates: use formats matching controller page addressing to minimize CPU reformatting.
- Development vs production: keep higher-quality (24-bit) sources and generate optimized assets for firmware builds.
Practical tips
- Read the display controller datasheet first — converter settings must match controller addressing, page size, and color order.
- Test with a small sample image to confirm byte order and packing before converting entire asset sets.
- Automate conversion in your build system so assets update consistently and reproducibly.
- Document chosen settings (format, palette, packing, dithering) in your project README for future maintenance.
- Keep original high-res sources and regenerate optimized versions when changing UI or display.
Quick checklist before exporting
- Resolution matches display.
- Correct pixel format (1-bit/4-bit/RGB565).
- Byte packing & endianness match controller.
- Dithering/palette selected if reducing colors.
- Compression or tiling chosen if needed.
- Generated file includes metadata and alignment.
If you want, I can generate specific export settings for a particular controller (e.g., SSD1306, ILI9341, ST7789) — tell me the display/controller model.
Leave a Reply