Image to RGB565 C Array Converter

Convert PNG, JPG, and WebP images to RGB565 arrays for TFT LCD and embedded display projects. Generate C/C++ output with endian and format options directly in your browser.

RGB565 image converter

Files are processed locally in your browser. No image data is uploaded to the server.

Input and options

No image selected yet.
Select an image to generate RGB565 output.

Preview and output

Original

RGB565 quantized

Pixels-
Output bytes-
Estimated flash size-
Array type-

C/C++ output

What is RGB565 image data?

RGB565 stores each pixel in 16 bits: 5 bits red, 6 bits green, and 5 bits blue. It is commonly used by embedded displays and TFT LCD modules because it reduces memory and bus bandwidth compared with 24-bit RGB.

How RGB888 is converted to RGB565

The practical conversion is r5 = r >> 3, g6 = g >> 2, b5 = b >> 3, then rgb565 = (r5 << 11) | (g6 << 5) | b5. This tool applies the same conversion in browser-side JavaScript.

C array output formats

Use 16-bit words when your graphics API accepts uint16_t color values. Use byte arrays when your display driver expects explicit byte order on SPI writes. Header and PROGMEM options help firmware integration.

Big-endian vs little-endian RGB565 bytes

Some display drivers send high-byte first, while others send low-byte first. Select the byte order that matches your display controller and library behavior.

RGB565 conversion examples

Color RGB888 RGB565 Big-endian bytes Little-endian bytes
Black#0000000x00000x00, 0x000x00, 0x00
White#FFFFFF0xFFFF0xFF, 0xFF0xFF, 0xFF
Red#FF00000xF8000xF8, 0x000x00, 0xF8
Green#00FF000x07E00x07, 0xE00xE0, 0x07
Blue#0000FF0x001F0x00, 0x1F0x1F, 0x00
Yellow#FFFF000xFFE00xFF, 0xE00xE0, 0xFF

Common TFT LCD image sizes

Small displays such as 128x160 or 240x240 can use static image assets directly. Larger sizes like 320x240 and above increase flash size quickly, so consider compression or partial rendering.

FAQ

What is an RGB565 C array?

An RGB565 C array is a sequence of 16-bit pixel values, usually stored as uint16_t or uint8_t bytes, used by embedded display drivers.

How do I convert a PNG image to RGB565?

Load the image in the tool, choose output size and format, then generate the array. The tool converts RGB888 pixels to RGB565 in your browser.

Should I use big-endian or little-endian RGB565 bytes?

Use the byte order required by your display controller and driver. If colors look swapped, try the other byte order.

Is the image uploaded to a server?

No. Image processing runs locally in your browser, and files are not uploaded by this tool.

Why does the converted image look different from the original?

RGB565 has fewer color levels than RGB888, so gradients and subtle colors may show quantization differences.

Related tools