Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

Problem displaying an image


Problem displaying an image

Postby dr_death_tm » Jan 28, 2007 @ 1:08pm

I have a noob question.
I'm working now on a game that uses GledPlay library.
There is a problem diplaying a background image (it's in PNG format).

Here is some screenshots:
What I have in my image editor:
http://ddtm.liceum.ru/annoidce/image.png
And what I get while testing my game in emulator/device/xp version:
http://ddtm.liceum.ru/annoidce/game.png
As you can see there a great difference in quality of images.

I use such code to copy image to back buffer:
Code: Select all

pBackBuffer->bltFast(0, 0, &(application->surface));
1 lines; 0 keywds; 2 nums; 12 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  
where surface is Surface with my background picture and pBackBuffer is a back buffer

Any clues to fix this problem?
dr_death_tm
pm Member
 
Posts: 2
Joined: Jan 28, 2007 @ 12:24pm


Postby Nikster » Jan 28, 2007 @ 2:33pm

I forget the bitdepth off hand (might be device dependent) but you get the banding because you have lower bits to play with compared to your PC, which can have 8 bits per color component, yeilding in 256 shades per color component, assuming gled uses 555 that means you have 32 shades per color component. so you lose color precision.
Nikster
pm Member
 
Posts: 14
Joined: Nov 16, 2006 @ 11:44am


Postby dr_death_tm » Jan 28, 2007 @ 2:45pm

Thank you for reply. Bad news for me. So there is the only solution, I guess: not to use gradients to make loss of color precision not so noticeable.
dr_death_tm
pm Member
 
Posts: 2
Joined: Jan 28, 2007 @ 12:24pm


Postby Nikster » Jan 29, 2007 @ 12:22am

Well, you could always use dithering, so quantize offline, this should show less banding.
Nikster
pm Member
 
Posts: 14
Joined: Nov 16, 2006 @ 11:44am


Return to GledPlay


Sort


Forum Description

Game Engine for Embedded Devices. Simple, complete, and powerful. Focused on the game.

Moderators:

Matias, Sergio

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron