Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Low quality textures on Raspberry Pi
- - By JeanC Date 2015-01-15 03:10

I've compiled SDL2 and installed Gosu on the latest version of Raspbian. I did a simple experiment in which I've used an image of the size of my monitor as a background. I'm baffled by the low quality of the drawn image. I can literally see color bands and pixels.

Any idea what can cause this degradation in performance ? I would have expected to see a crisp clear image ...


Parent - - By jlnr (dev) Date 2015-01-15 10:26
Nope - this project is all about displaying large images and as far as I know, it works just fine:

Can you provide a screenshot or photo of what you are seeing?
Parent - - By JeanC Date 2015-01-15 16:22
I think it is because I've used a color gradient for the background of my game, something similar with what I've attached here . I think it has something to do with the way SDL2 scales up the images, although in this case I kept the image as it is (no scale), the result is, poor, like a of bands of colours effect.
Parent - - By jlnr (dev) Date 2015-01-15 17:14
This is really curious. Gosu only uses SDL 2 to set up an OpenGL ES context, all rendering is handles by OpenGL.

Does the image look good if you open it in a web browser on the Raspberry Pi?
Parent - - By JeanC Date 2015-01-15 18:20
Yes it looks good, . I've also written a C++ SDL2 code that loads same image and I see the same problem - color bands.
Parent - - By jlnr (dev) Date 2015-01-15 18:47
Do you think it might be the image loading code? Gosu uses libfreeimage - what did your C++ test use, SDL_image?

FWIW the screenshot in your post to looks a lot worse here than the image three postings up - but that might just be a side-effect of you uploading the image to imgur. Their compression is extremely lossy.
Parent - - By JeanC Date 2015-01-15 19:10
I've used SDL_Image, is FreeImage a better alternative ?
Parent - - By jlnr (dev) Date 2015-01-15 19:18
If both SDL_Image and FreeImage (Gosu) lead to bad image quality, then no...

I think I'm out of ideas. Just don't use gradients ;P
Parent - By JeanC Date 2015-01-17 06:24
Thanks, I will probably use other type of image for the background (BTW, there is a "solution" to use a larger image than the window size for the background and scale it down ... this will preserve the smoothness of the gradient).
Parent - By JeanC Date 2015-01-15 16:23
I did more tests and it seems that the problem is present only when you use an image that was filled with a colour gradient. For regular photos or sprite animations Gosu works as expected.
Up Topic Gosu / Gosu Exchange / Low quality textures on Raspberry Pi

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill