Screens/Screens you have to keep feeding/RGB565, 666 and 888
Lesson 10 of 16 · in 3D and VR

RGB565, 666 and 888

RGB565, RGB666 and RGB888 say how many bits make one pixel. They do not say how many wires carry it. A 24-bit pixel can cross eight wires in three beats, and a 16-bit interface may not use sixteen wires in a row.

Lonely BinaryUpdated 2026-10-014 min readNo board required

View it in VR

Lesson 10 of the Screens course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/screens/10

Two numbers get mixed up here. Bits per pixel is how much colour a pixel holds. Bits per transfer is how many bits the interface moves at a time. The first belongs to the picture and the second to the bus.

RGB565 is 16 bits a pixel: five red, six green, five blue. The extra bit goes to green, commonly explained by the eye being most sensitive to green. RGB666 is 18 bits, six per channel. RGB888 is 24 bits, eight per channel.

Wires are not bits

A 1024 × 600 frame is 1.2288 MB in RGB565 and 1.8432 MB in RGB888, whatever the bus looks like. The bus decides how long it takes to move.

The ESP32-S3 can carry RGB888 over an 8-bit serial RGB data path, so one 24-bit pixel takes three 8-bit transfers. That three is just 24 divided by 8, our arithmetic and not a separate setting. The pixel clock then ticks three times for each pixel, and the same 8 wires have to run three times as fast.

Sixteen wires, but not D0 to D15

The ILI9341's 16-bit RGB interface uses D[17:13] and D[11:1] of its 18-line bus. That is five lines for red, and eleven for green and blue together, and D12 and D0 are skipped. A controller's pin table is the only place to read the mapping. Sixteen consecutive GPIOs wired to D0 to D15 put the colour bits in the wrong places.

The picture keeps its shape when that happens, because the sync signals are untouched. Only the colours go wrong.

On the ESP32

The ESP32-S3 has 8- and 16-bit parallel RGB data lines on LCD_CAM, which is the configuration this course uses, in RGB565. 24 bits a pixel over 8 lines is the serial form above. The ESP32-P4 has RGB as well, and the classic ESP32 has none.

Common mistakes

  • Counting wires from the pixel format. RGB888 is not 24 wires. The bits per pixel and the bits per transfer are separate, and the second one is what sets the pixel-clock multiple.
  • Assuming 16 bits are D0 to D15. On the ILI9341 they are not. Follow the pin mapping in the datasheet.
  • Blaming one wire for a green cast. A wrong pixel format, a wrong colour order or shifted bit positions each give a different colour error. A green picture is one symptom with several possible causes.

Edit this page — content/fundamentals/screens/rgb-colour-depth.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →