Getting a custom image to display on LCD

Hello again, and thanks for any help in advance.

I am using an Uno with the 1.77" TFT LCD screen.

In my program, I have it initially, when it starts up, display an image stored in the SD card that fits in the screen. When I use the logo.bmp image provided in the Arduino tutorial located here:

It works just fine! However, if I use my own bitmap, which I attached to this post, it doesn’t work. I have this code in the program:

if (!SD.begin(SD_CS)) {
myScreen.background(0,0,0);
myScreen.stroke(0,255,0);
myScreen.text(“SD card error”,0,0);
delay(5000);
}

// initialize and clear the GLCD screen
myScreen.begin();
myScreen.background(255, 255, 255);

// load the image from the SD card
image = myScreen.loadImage(“popup2.bmp”);

// check if the image loaded properly
if (image.isValid() != true) {
myScreen.background(0,0,0);
myScreen.stroke(0,255,0);
myScreen.text(“error while loading popup2.bmp”,0,0);
delay(5000);
}

When I use the image provided by Arduino, it skips the error message and displays the image. When I use my image, it displays the “error while loading popup2.bmp” and does not display my image.

I can’t figure out what is different for me. I am using the same file format, the same color bit depth…anyone have any suggestions?

logo3.zip (394 Bytes)

logo3.zip (394 Bytes)

can you post the image that does work please.

Also, is it because you are loading popup2.bmp instead of logo3.bmp?

Also, Also,

USE CODE TAGS! click the </> button

Ah yes, I'll use code tags in the future. And no, the code we have loaded on the board is looking for logo3.bmp, not popup2.bmp. The code I posted was when we were trying the same image in a different color format.

And here is the link for downloading the image that does work:

https://www.arduino.cc/en/uploads/Tutorial/logo.bmp

rynchor: I can't figure out what is different for me. I am using the same file format, the same color bit depth...anyone have any suggestions?

I can find out the difference very quickly by just looking at the file size:

Your logos is file size 10358 bytes. And the working logo file size is 6966 bytes.

Your logo3 is picture size 160x128 pixels. And the working picture size is 48x48 pixels.

Your logo3 is bit depth 4. And the working logo is bit depth 24.

So what makes you believe that the logo might be compatible?

The screen is supposed to support images up to 160x128 pixels, at a bit depth of up to 24. I have tried combinations of resolutions and bit depths (including making my own 48x48 24 bit image) ranging all over from Photoshop, but still, the only logo that works is the one from Arduino. There must be another property that I am missing, but the tutorial is not at all specific on the bmp preferences beyond resolution and bit depth.

rynchor:
The screen is supposed to support images up to 160x128 pixels, at a bit depth of up to 24. I have tried combinations of resolutions and bit depths (including making my own 48x48 24 bit image) ranging all over from Photoshop, but still, the only logo that works is the one from Arduino. There must be another property that I am missing, but the tutorial is not at all specific on the bmp preferences beyond resolution and bit depth.

What about compression? Did you save the file as uncompressed bitmap?

I include a modified logo, 96x96 pixels, 24-bit color depth, uncompressed.

Does this work?
(I had to zip the file, otherwise the forum would not accept the attachment.)

logo_modifiedZipped.zip (2.4 KB)

If jurs solution does not work, then post the library for your screen, that way we can track down the error.

Honestly I hate libraries that say "Cannot do something", and you are left think "WHY?!?!?"