Closed drewmo closed 4 years ago
Hello,
First of all, I see that the tool, you use to convert bitmap to code, uses different RGB components order, than it should be for your display:
The library sends bytes from bitmap to display using the following code:
this->m_intf.send( buffer[0] );
this->m_intf.send( buffer[1] );
The library uses 8-bits serial 65k color mode. According to datasheet the color components should be encoded in thee sequence CCCCCBBB (first byte) BBBAAAAA (second byte). So in your case red component from your bitmap will look like 00000000 11111000 (blue with a little green shade), green will look like 11100000 00000111 ( red with a little blue shade ).
Change byte order in your bitmap. It should help
Thanks for the help. I am trying to figure out this the conversion tool but am not where where the section is that handles the RGB order. I see there is an invert function but I am not calling that argument and it's only for XBM format images. I am working off of that and seeing if I can do some bitwise operations to change the order but that is all new to me.
For your library (lcdgfx) does it require red to be 0x00
or 0xf8
? or do you mean it's a two byte pair of RED = (0x00, 0xf8), GREEN = (0xe0, 0x07), BLUE = (0x1f, 0x00)
. From what I can tell the image is that format.
I'm sorry for long reply.
You need to swap bytes in your bitmap: 0x00, 0xf8, 0x00, 0xf8
-> 0xf8, 0x00, 0xf8, 0x00
For some reason when I am trying to call
display.drawBitmap16()
and pass in my converted .bmp file I am not seeing the images in the correct color on the screens. I have some SSD1351 OLEDs which displays colored fonts fine when I usedisplay.setColor()
and pass inRGB_COLOR(XXX, XXX,XXX)
. The RGB images being displayed seem to end up shifted or switched.For reference here is a converted image that I have created it in Photoshop using RGB mode with 8Bits/channel and saved in 565 format as required in the docs.
I convert the .bmp files using bmp2hex which outputs the following struct, I did slightly alter the output as they originally output the pixel data as a
uint8_t *pixel_data
which wasn't right for this library.Here is what I see in Photoshop:
and here is what it looks like on my screen:
I've tried looking in the library to see if there is somewhere I need to specify the RGB order, or other similar image requirements but I am scratching my head over this. I have some more complex images I would like to display on screen which would be very difficult to alter in a way to fudge them into looking correct on the screen so I am hoping someone can let me know if maybe I am doing something wrong.