Games Sprite image quality

developer_123

Active Member
Licensed User
Longtime User
In my Cross-Platform Game, I use sprites with relatively good image quality in .PNG files. When compiling and executing the application in B4J, the quality of the images looks relatively similar to the original sprite, it loses some detail but it is observed with some sharpness.
When compiling the same application and running it in B4I, both on my iPhone and in the simulator, the images of the sprites considerably lower their sharpness and lose a lot of details.
When compiling the same application in B4A and running it on my Android, the sharpness of the sprite images drops very considerably, obtaining a rather rustic and visually poor feeling. The animations look very pixelated and blurred.

I appreciate any help that guides me to optimize the quality with which the images of the sprites are displayed in the best way.
 

developer_123

Active Member
Licensed User
Longtime User
Thank you Erl for the link. As the character of my application is not so big, I proceeded to do the tests to observe the difference in the Walking Character application. The result is that in B4A it does improve but for relatively large objects. For smaller objects the image is still too distorted. In B4i I thought I was going to improve something, but it looks the same as before. B4i also loses a lot of image quality. In B4J there was no difference with the new code.

I would like to know if there is any other more efficient method, or if it is just a matter of playing with sizes and proportions, because I think that playing with sizes and proportions should not be ideal, since a game can have multiple sprites and it would be very tedious to have to do this for each and every one of the images, taking into account that the original PNG image is quite sharp, and that the original image is requested from the artist with the best quality to have to download it within the application.
 

emexes

Expert
Licensed User
B4i also loses a lot of image quality.

Maybe test scaling down from your master sprite images "manually" to match the B4i device display resolution. Or try with dummy sprites of say just 10x10 pixel squares with a 2 pixel border, and compare against screen capture to ensure no rescaling happened in the graphics pipeline. If those sprites display ok, then do the same test again but to say 20% larger (or display the sprites 20% smaller) ie higher than the B4i device display resolution, to see what effect the (presumably) GPU hardware downscaling has.

Also check a screen capture for clues about the pixel blurring eg does it look like it is occurring as 2x2 pixel blocks? I have a vague recollection about retina displays being twice the resolution of previous displays, and that ideally apps are supposed to provide both standard and retina resolution icons etc; maybe somehow the GPU isn't getting the retina-resolution version of your sprites.
 

emexes

Expert
Licensed User
to see what effect the (presumably) GPU hardware downscaling has.

Like, perhaps scaling is being done using nearest-pixel method, which is faster than averaging or interpolation, but looks not-so-good, especially if the original image is palleted and/or dithered, or the source image was captured from a display where subpixel rendering has been applied (... although I guess then the B4A device should be exhibiting similar issue šŸ¤” ).

Sorry about these ideas being a case of the blinder leading the blind. but once we stumble onto the cause of the B4i sprite blurriness, it'll all seem uh blindingly obvious. :cool:
 

emexes

Expert
Licensed User
Or try with dummy sprites of say just 10x10 pixel squares with a 2 pixel border

Better make those numbers odd rather than even, just in case there is any 2:1 scaling going on, eg say 9x11 pixel squares with a 3 pixel border.


and compare against screen capture to ensure no rescaling happened in the graphics pipeline.

Best check the dimensions (number of pixels) of the screen capture against the device display too; I know of one emulator that produces smaller screen captures than the display, and it wouldn't surprise me if that started happening on real devices too as screen resolutions (and screen capture image sizes) went up over time.
 
Top