Im a little confused about how i can display red on my 7,5" Waveshare BWR display - i get an image into gimp, export it as XBM and put the hex code in the .h file with the appropriate syntax. But as soon as i upload the code with the new image, the parts that where previously red are now "striped" (maybe you remember how colors were depicted in old B/W - like small dots for red, tight lines for yellow or whatever). I still dont know how the "correct" way to convert an image to hex code is, but i have no idea how i can make it work with red color in my case. Any suggestions are welcome, thanks in advance!
Please read How to use this forum - please read.
Please always post a link to the display in question, and tell which library or demo code you use.
It looks like you use the Waveshare 7.5" b/w/r e-paper display.
If so, then please edit the title of your first post and add - for e-paper.
Click Modify on the first post, then you can edit the title.
Both Waveshare and Good Display have documentation on how to create bitmap code using image2lcd.
But the Good Display demo code uses a special format for its 3-color bitmap.
Most other demo examples use separate 1-bit per pixel bitmaps for b/w and r/w.
I never have created a bitmap for e-paper myself so far, so I have no experience.
Jean-Marc
Hello, thanks for the reply - this is rather a question about the C++ hex code format, because im confused how it is possible to break down a normal RGB range of 000000 - FFFFFF into just 0x00 - 0xFF? The good display site says
"Q:The red color of the e-paper display is shallow, why?
A:Modify the code: command: 0x30, data: 0x3a; command: 0x82, data: 0x28 (for 15 degrees or more)"
But i have to be honest, i have 0 clue what they mean with that - i just want to know why the red color gets lost somewhere between upload and display. Here is some technical info:
Board: ESP32 Dev Module
Used Libraries: GxEPD (i think this one is actually made by you?) Version 3.0.4 , Adafruit_GFX Version 1.3.6
This is my test code and my test image (see attachements)
Thanks a lot
SPI_test_example.ino (23.4 KB)
BitmapExamples.h (1.18 KB)
GxEPD has several methods to draw bitmaps, in addition to the inherited methods provided by Adafruit_GFX.
// to buffer, may be cropped, drawPixel() used, update needed
void drawBitmap(const uint8_t *bitmap, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color, int16_t mode = bm_normal);
// to full screen, filled with white if size is less, no update needed, black /white / red, for example bitmaps
void drawExamplePicture(const uint8_t* black_bitmap, const uint8_t* red_bitmap, uint32_t black_size, uint32_t red_size);
// to full screen, filled with white if size is less, no update needed, black /white / red, general version
void drawPicture(const uint8_t* black_bitmap, const uint8_t* red_bitmap, uint32_t black_size, uint32_t red_size, int16_t mode = bm_normal);
// to full screen, filled with white if size is less, for 3-color example bitmaps
void drawExamplePicture_3C(const uint8_t* bitmap_3C, uint32_t size_3C, int16_t mode = bm_normal);
// to full screen, filled with white if size is less, no update needed
void drawBitmap(const uint8_t *bitmap, uint32_t size, int16_t mode = bm_normal); // only bm_normal, bm_invert, bm_partial_update modes implemented
The drawExamplePicture_3C() method is only available for your 7.5" b/w/r GxGDEW075Z09; I think it takes a special 4 bit per pixel format, 2 pixels in one byte.
The other methods take 1 bit per pixel format, 8 pixels packed per byte. b/w and r/w in separate bitmaps.
It is your task to extract the 2 "colors" into separate bitmaps, using a program that can do that.
You could also use a 16bit per pixel bitmap and render it through Adafruit_GFX::drawRGBBitmap(); GxEPD drawPixel() will then decide for each pixel if it should be presented as black, white, or red. But this eats a lot of program memory.
The answer from Good Display doesn't concern bitmap representation, but red (and black) intensity. This is dependent on ambient temperature, and on the VCOM or VCOM_DC value, changeable in the program.
I think you need a picture editing program to first separate black and red color channel into separate pictures, and then either directly creating 1 bit per pixel C code representation, or first creating 1 bit per pixel bmp pictures and then create C code.
Jean-Marc
THe drawExamplePicture_3C actually worked with red - i have to figure out now why instead of one large image, i have two copies in the upper corners and a white blank in the lower half, and why some of the black is turning red too, but so far so good, thanks!
Does the GxEPD_Example.ino work with the example bitmap? What processor do you use?
i tried gxepd_example - the color works in the font test, but as soon as i upload my own hex code of the image its b/w again. the b/w/r worked with the same hex code when using the BitmapPicture_3C, but like i said the image was screwed in other ways. wondering how i can solve that, im feeling like what im trying to achieve is a lot harder than it sounded and i have no idea what i do next... i dont even know if i need two seperate hex files for BWR after all
It is certainly easier to create two separate bitmaps for b/w and r/w, than to create a bitmap for drawExamplePicture_3C().
The method drawExamplePicture_3C() was only added to be able to show the demo bitmap for this e-paper. All other 3-color e-paper demos have color separated bitmaps.
I don't even know the format for drawExamplePicture_3C, I would need to look at the code. I think I was wrong, it may use 2 bit per pixel, for black/grey/red/white, but the controller buffer uses 4 bit per pixel.
I propose you create a pure b/w bitmap first, try that, and then add the r/w bitmap.
Note that for the methods that draw directly to the screen the bitmap(s) need to be of correct size (w, h) to fit to the screen. Width needs to be exact, else the picture will be distorted. If height is less, the remaining part of the screen is filled with white.
okay, i will try - sorry to ask, but do you know of any ways to convert bitmaps that you know work well? in the end, i want to fully automate the process between inputting a jpg/png, and outputting one or multiple files that are ready to be uploaded the show the image
I hope someone else reads this topic and can help you.
I have no experience, but I have read that gimp and image2lcd are used for this purpose.
Maybe you find more information here: Home · olikraus/u8g2 Wiki · GitHub
Jean-Marc