Trouble drawing PNG images on Raspberry Pi

I have a very simple app that displays a sequence of a few PNG images. When I compile an run it on a Mac it displays the images just fine, but when I compile the same app on a Raspberry Pi the .draw just displays all white, not the PNG image.

The images I’m trying to display are 1920x1080 PNG files. I did some tests with smaller images and they worked, but I’m not able to display the larger images.

Any clues as to why PNG images might not be displaying in oF on the Rpi but work fine on a Mac?

usually this means you need to increase your GPU memory. 128 is a good start. Another way to check is to resize the image (try 1/2 or smaller) in photoshop and see if it works

Thanks! That almost works. I’m hesitant to shrink the images since these images contain a lot of fine detail and text that needs to be seen.

Increasing the memory allocated to the GPU did allow oF on RPi to display larger images, but not the 1920x1080 images I’m trying to display. I was starting to think that there was a problem with my PNG files, so I converted them to JPEG and I’m still getting the same results, just displaying white instead of the images.

It’s strange, I can run X and display these images full screen in the image viewer, but cannot get them to display in oF with an image draw.

I’m stumped.

are you running your app under X11?

If you have a 512 mb pi, I like to run with a 50/50 split so I set my GPU to have 256 MB of RAM. I just displayed a couple 1920 by 1080 RGBA PNG files on my pi so you shouldn’t have an issue unless you are trying to load a whole bunch at once, then you might be running out of memory.

It’s working!

I was loading images one at a time, but it seems that some of the images were larger than 1920x1080 (which I wasn’t expecting) and so those didn’t seem to load properly and were displaying as just white. So it probably wasn’t the image.draw causing the problem but the image.loadImage. Perhaps it’s some sort of memory allocation thing.

Anyway, once I went and manually resized all the images to exactly 1920x1080 I was able to get them to display properly.

Thank you all for the help. I was ready to give up on the RPi, but now it’s working fine!

Wonderful!! If you hit any more issues, try posting here or if it really is an issue, file a bug on the Rpi Branch on github. I’ll be monitoring the forum more. We might need to add an RPi subsection.