1.54-inch 3-Color E-Paper problem with the red color AND It has in fact 4 colors

Hi guys!

This is going to be my first post here! I really appreciate any comments or help!

So the story is like this:

While I was playing around with my 1.54” 3-Color EPD (200x200), which is compatible with the Waveshare 1.54 b/w/r EPD, I noticed that using the GxEPD or GxEPD2 library from @ZinggJM (btw. I am very grateful for this super library!! Thanks a lot!) I can only get a pinkish-red color displayed instead of that intensive red of the demo picture that was originally on the display when I got it.

So I tried a little bit more with both the demo codes from Waveshare and GxEPD(2) library and using different bitmaps, and I found out by using the demo code of waveshare I am able to get the intensive red, and simultaneously the pinkish-red, as well. Which means in fact, the 3-color EPD can display 4 different colors: White, Pink, Red, Black. (Please take a look on my photo, and look at the left upper corner)

To achieve that, I noticed that the pinkish color is simply red without black at the same spot, and the intensive red is black underneath the red. You can take a look at the bitmaps I am using. (I attached how the bitmaps look) bitmaps.jpg

Thus, because you can display 2 color layers you can display the 4 types of color for a pixel by having:

Color Black Layer Red Layer
White No No
Pink No Yes
Red Yes Yes
Black Yes No

Now, the problem is that this only works with the library and demo code provided by Waveshare. Because it seems to refresh both given color layers. When I trying display the same bitmaps with GxEPD2, I can only get the pinkish red (so only 3 colors, please take a look at my photo).

And the code I am using with GxEPD2 is:
code.ino

#define ENABLE_GxEPD2_GFX 0

#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include "data.h"
GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println();
  Serial.println("setup");
  delay(100);
  display.init(115200);
  display.fillScreen(GxEPD_WHITE);
  display.setFullWindow();
  drawBitmaps();
  display.display(false);
}

void loop() {
  // put your main code here, to run repeatedly:

}
void drawBitmaps()
{


  display.drawInvertedBitmap(0, 0, IMAGE_BLACK, 200, 200, GxEPD_BLACK);
  display.drawInvertedBitmap(0, 0, IMAGE_RED, 200, 200, GxEPD_RED);
 
}

The data.h contains the 2 IMAGE_X bitmaps as C array.

The same bitmaps C arrays are used with Waveshare demo code.

It seems like the GxEPD(2) will combine both red and black layer into one picture and then separate the colors. Thus the red color cannot have the black color underneath before it refreshes out. The same also happens on other drawing functions like fillRect or Circle.

Did this only happen on my EDP? Unfortunately, I do not have another one to test, so I appreciate any comments!
Thanks in advance! :slight_smile:

bitmaps.jpg

@yushen0407,

your observation concerning GxEPD and GxEPD2 is correct, but the reason may be more complicated.

GxEPD and GxEPD2 support only one bit b/w for the black/white channel, whereas the controller has 2 bits, supporting grey levels. This is a special feature of this panel and controller.

If you need this feature, you need to use the library from Waveshare.

Jean-Marc

@ZinggJM

Thanks for your fast reply! Really appreciate that!

Actually my problem is that while using GxEPD2 the red is quite light (the pinkish-red), and that makes texts or icons not well readable. And my question would be, is there any way to have the intensive red being displayed as red using GxEPD2? Well, in fact, to not have the "grey level" does not really bother me, so it is enough for me to have b/w/r colors, but the red should really be the deeper red.
:slight_smile: :slight_smile:

(I have seen many pictures and videos, where they have the deep red color on their EPD, I don't know if there might be anything I made wrong while coding with GxEPD2)

(Or did you mean that the one I am using uses a different controller, and uses grey level to control different colors?[White/Pink/Red/Black])

@yushen0407,

To give any meaningful answer I would need your picture/bitmap/bitmaps and the method call used to display it. Or even better your whole example. I then could check with my 1.54" b/w/r.

It may be the conversion of the b/w single bit per pixel to the 2 bit per pixel value for the controller.

For comparison I would also need the example for the Waveshare library.

How do the bitmaps of the example for GxEPD or GxEPD2 look on your display? I don't think they looked too pale when I tested last time.

I don't think your display has a different controller, otherwise you wouldn't see anything. But it might use a different waveform table. But you get deep red with the Waveshare code.

Jean-Marc

@ZinggJM Best thanks for your time and effort!!

Here again, is the comparison, left is the WS lib and right is GxEPD2 showing the same black and red bitmaps. As you can tell, the WS version of strawberry has a deeper red.

And here is also another photo, where you can see the icons (especially the raindrops in these small icons, which are red, are too light and nearly not noticeable)

I uploaded both codes (and the waveshare library, in case you do not have it, you can import the zip). You can try it out, both use the same converted bitmap array. And I also uploaded the bmp files, in case you might need to examine them(bB.bmp is the black layer, bR is the red one). I converted them using Image2Lcd v2.9 as an inverted format.

I hope you can see the difference of red-intensity (at least after you have tried the codes). I really appraciate your help and the time you have invested! Thanks again!

P.S.: And as you might see in the bitmap or the code, I can get this deeper red by having both something(color bit) on black and red layers at the same place. But GxEDP looks like to ignore the black, when I e.g. :

display.drawInvertedBitmap(0, 0, IMAG, 200, 200, GxEPD_BLACK);
display.drawInvertedBitmap(0, 0, IMAG, 200, 200, GxEPD_RED);

The blue line will be ignored, and the outcome effect is the same whether you have the line of code. It only draw the second line (GxEPD_RED) which is becoming the pinkish-red.

Epaper8266Strawberry-Waveshare.zip (9.95 KB)

Strawberry GxEPD2.zip (7.59 KB)

EPD Waveshare Lib.zip (61.2 KB)

Picture of Strawberry.zip (69.5 KB)

@yushen0407,

I may have time for this tomorrow.

But what I can tell you now is that if you use buffered drawing methods, the second drawInvertedBitmap just overwrites the result of the first.

You would need to use the method to draw directly to the controller buffer, the method that takes both bitmaps as parameters.

That's all for now, I am busy.

Jean-Marc

@ZinggJM

Ok, I see!

Many thanks in advance!

@yushen0407,

your strawberry looks perfect on my 1.54" b/w/r e-paper from Waveshare, with your unmodified EPDTest.

Either your panel (and the actual ones from Waveshare) need a different waveform table, or you have an issue with marginal supply voltage to the panel, when run with ESP8266, as your e-paper board may have an LDO and level converters.

I will not spend more time on this, unless someone donates (sends) an actual version from Waveshare to me (or the variant you have).

Jean-Marc

This display does provide a deeper red, if black and red is set in the controller memory. This is different to other 3-color e-papers that produce a deeper black in this case.

#define ENABLE_GxEPD2_GFX 0

#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include "data.h"
GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println();
  Serial.println("setup");
  delay(100);
  display.init(115200);
  display.fillScreen(GxEPD_WHITE);
  display.setFullWindow();
  drawBitmaps();
  display.display(false);
  delay(5000);
  display.drawImage(IMAGE_BLACK, IMAGE_RED, 0, 0, 200, 200, false, false, true);
  display.powerOff();
}

void loop() {
  // put your main code here, to run repeatedly:

}
void drawBitmaps()
{


  display.drawInvertedBitmap(0, 0, IMAGE_BLACK, 200, 200, GxEPD_BLACK);
  display.drawInvertedBitmap(0, 0, IMAGE_RED, 200, 200, GxEPD_RED);

}

ZinggJM:
@yushen0407,

your strawberry looks perfect on my 1.54" b/w/r e-paper from Waveshare, with your unmodified EPDTest.

Either your panel (and the actual ones from Waveshare) need a different waveform table, or you have an issue with marginal supply voltage to the panel, when run with ESP8266, as your e-paper board may have an LDO and level converters.

I will not spend more time on this, unless someone donates (sends) an actual version from Waveshare to me (or the variant you have).

Jean-Marc

This display does provide a deeper red, if black and red is set in the controller memory. This is different to other 3-color e-papers that produce a deeper black in this case.

#define ENABLE_GxEPD2_GFX 0

#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include "data.h"
GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/CS=D8/ SS, /DC=D3/ 0, /RST=D4/ 2, /BUSY=D2/ 4));
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println();
  Serial.println("setup");
  delay(100);
  display.init(115200);
  display.fillScreen(GxEPD_WHITE);
  display.setFullWindow();
  drawBitmaps();
  display.display(false);
  delay(5000);
  display.drawImage(IMAGE_BLACK, IMAGE_RED, 0, 0, 200, 200, false, false, true);
  display.powerOff();
}

void loop() {
  // put your main code here, to run repeatedly:

}
void drawBitmaps()
{

display.drawInvertedBitmap(0, 0, IMAGE_BLACK, 200, 200, GxEPD_BLACK);
  display.drawInvertedBitmap(0, 0, IMAGE_RED, 200, 200, GxEPD_RED);

}

OK! Thanks alot @ZinggJM!I really appreciate that! Yes I am using a ESP8266, that might be the problem. I will try it with another arduino board.