GxEPD2 and GxEPD2_4G, confused which one to use for Waveshare 7.8" grayscale panel

First of all kudos to @ZinggJM for creating the GxEPD2 library! I managed to get it working on my LILYGO TTGO T8 ESP32-S2 board and my Waveshare 7.8" display (IT8951 controller, and grayscale support). My code can load a BMP from the SD card and display it on the screen. Awesome! :grinning:

One thing that I didn't mange to get working yet is to display images with grayscales. Currently black & white BMP's (1 bit) work great. When I try to display grayscale BMP's (whatever bit depth I use for the BMP, the image is displayed monochrome on the screen. It seems that the gray colors are translate to pure black or white. Is my assumption correct if I say the GxEPD2 library only supports black and white (1 bit) images, in combination with the IT8951 based Waveshare 7.8" screen?

I also noticed there is a new(?) GxEPD2_4G library. Is my assumption correct that my IT8951 based Waveshare 7.8" screen is not yet supported in the GxEPD2_4G library?

Thanks for confirming my assumptions. If they are correct, I'll wait for grayscale support with my IT8951 based Waveshare 7.8" screen.

J

Hi @jtlnsbe , welcome to the forum!

These kinds of questions usually mean that I myself have to look up my code to answer!

GxEPD2 is for b/w graphics, and 3-color, 4-color and 7-color graphics.
It additionally supports direct drawing of "native" bitmaps, dependent on the driver class.
E.g. for IT8951 controller driver classes, see e.g. GxEPD2_it78_1872x1404.h:

    void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);

But it doesn't have a depth or bpb parameter, and I don't remember what it does.

GxEPD2_4G is for monochrome displays that support up to 4 grey levels. Mostly used for displays that can show 4 grey levels as an alternative to fast partial update (differential refresh).
It doesn't support displays with controller IT8951.

GxEPD_HD is for e-paper displays with 16 grey levels.
It supports 16 grey level graphics and direct drawing of monochrome bitmaps with specific depths or bits per pixel. See e.g. GxED078KC2.h:

    void drawImage(const uint8_t* bitmap, uint32_t size, uint8_t depth, uint16_t x, uint16_t y, uint16_t w, uint16_t h);

-jz-

Thank you so much for the swift response! I was not aware of the GxEPD_HD library. I'm using that one now, and my grayscale BMPs are not displayed in their full glory.

Once again thanks for the amazing work. #communityrocks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.