Color of images inconsistent on device when using display.newImage()

I have a large background tile (with no transparency) that is 480x320 (landscape mode) and resolution set to 480x320.

I have another image with transparency, which is just small piece of the background image. When I try to overlay the small piece on top of the background, the colors do not match. It looks like the overlay piece has a dithering effect applied to it.

This occurs regardless of scaling mode (none, letterbox, zoomEven, zoomStretch, etc.)

Reproduction Steps:
Place background tile on screen using

display.newImage(‘bg-clubhouse-interior2.png’)

then place overlay image directly on top of it

display.newImage(‘bg-clubhouse-interior-door-frame.png’)

Even though the colors in both of the PNG images are exactly the same, when viewing on the device (Android), the overlay image is slightly lighter, and has a dithering pattern. This results in an obvious graphical flaw to the player.

NOTE: The simulator looks fine. This bug is only visible on the device (I am using an Android 2.2 device)

Example (screenshots)

http://www.dropbox.com/gallery/19046160/1/corona-bug?h=832a74

I already filled out a bug report (case #8711), but instead of waiting for a future build (which may or may not have a fix), does anyone have any ideas/workarounds in the meantime?

p.s. note to admin: It seems the forums are a better place to keep track of bugs, since I can’t edit my original report, and couldn’t attach multiple images. [import]uid: 49447 topic_id: 16419 reply_id: 316419[/import]

Your image links show up as a 404 error on DropBox for me.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16419 reply_id: 61310[/import]

thanks, updated it with a link:

http://www.dropbox.com/gallery/19046160/1/corona-bug?h=832a74 [import]uid: 49447 topic_id: 16419 reply_id: 61326[/import]

A not-very-ideal workaround would be to save the background image as a png with transparency so it will be dithered in the same way as the piece image. At least then there won’t be a noticeable difference.

[import]uid: 9422 topic_id: 16419 reply_id: 61372[/import]

Everyone,

After doing some digging, we discovered that Android’s OpenGL surfaces have a 16-bit color depth by default. In fact, you can see this issue on an Android device’s web browser app by going to a website that has lots of gradients. So even though Corona sets up OpenGL to use 32-bit color on the C++ side, the Android OpenGL surface on the Java side was limited to 16-bit.

Now here’s the good news!
We have found a way to bump up the color quality on Android from 16-bit to 32-bit. This is a huge color quality improvement! This also means that images that have had bad banding/striping issues with gradients should go away.

This enhancement will be made available in the next daily build, #642. [import]uid: 32256 topic_id: 16419 reply_id: 61956[/import]

Outstanding! Thanks for the update, looking forward to testing it out. Happy to hear this was a fix for some other issues as well.

Mark another one for the Ansca dev team.

update: fix worked, thanks! [import]uid: 49447 topic_id: 16419 reply_id: 62055[/import]