4

I have a question about pixels and screen resolution of an Android device.

The app I developed was at the time when Samsung Galaxy S III was new. The images for my app had a resolution 2310x1300 (ratio 1.777 to fit screen). Samsung Galaxy S III has a resolution of 1280x720. I chose a higher resolution to have some margin for future devices with larger screens and higher DPI.

But that's not enough these days - Galaxy S6 has a resolution of 2560x1440, that is far higher than the resolution of my images. So I thought that the quality of the images for such a device would be deteriorated since the resolution of the images is lower than the resolution of the display. But when testing the app for the Galaxy S6 I cannot see any differences right now - the images scaled for the new device (image resolution of 2310x1300 used in a device with 2560x1440) is at least as good as for an older device with lower resolution.

Have I completely misunderstood how dpi and resolution works?

The images resources are under the /res/drawable/hdpi folder.

  • Googling could have possibly helped- from sister site superuser.com/questions/441799/… – beeshyams Jan 20 '16 at 16:07
  • Can anyone explain how is this relevant to an end-user? DIP (not DPI) and resources are something an end-user wouldn't be bothered with, unless modding an APK. – Firelord Jan 21 '16 at 7:32
2

As mentioned in @w3dk 's answer, you can't see any difference because you can't see any difference. As in, your eyes literally can not differentiate between the detail of the picture on either the Galaxy S3 and the Galaxy S6, because in either case, the picture resolution comes close to the eye's limit of resolution (the minimum angular separation of 2 distinct points/objects from a particular distance of observation for which they can be discerned to be distinct from each other). What I will address here are some of your concerns as a developer.

The S3 was a xhdpi device, so any apps on it will use image resources in the /res/drawable/xhdpi/ folder. The S6 is a xxxhdpi device, and so any apps on it will use the resources in the /res/drawable/xxxhdpi/ folder by default, but fall back to the next lower resolution if the requisite folder is not available, utilizing fast image scaling to show the images at the required abstract resolution (dip (device independent pixels), not pixels) (dip are hardware-independent, pixels are hardware-dependent).

You are correct in assuming that image quality should have deteriorated under normal conditions, but your images are in fact pretty high-resolution, and combining that with some downscaling on-device for the S6, you actually get a similar quality image as on an S3.

Why do I say downscaling even for the high-resolution S6? Simple. You're probably not using the whole screen to display the image, and probably what dip resolution you specified maps out to less than 2310x1300 real hardware pixels, so the image is downscaled.

Contrary to what one may think, downscaling from a high resolution source actually increases image quality, and upscaling from a low resolution source decreases it on final display, given the same final display resolution and similar (except in resolution) source images. Here is my source about scaling as regards image quality.

As @DanHulme succinctly put it:

"An image which has been downscaled from a high-resolution source will look better than one which has been upscaled from a low-resolution source."

  • A followup on the quote: Assuming your scaling algorithm is good-quality. Whatever you do, don't use nearest-neighbor! – JAB Jan 20 '16 at 18:25
  • @JAB I prefer bicubic where possible. – Tamoghna Chowdhury Jan 21 '16 at 9:06
  • But isn't Galaxy s3 rather a xhdpi device than hdpi? According to developer android xhdpi (320 dpi) is closer to 306 dpi than hdpi (240 dpi). And furhtermore - I changed folder for my images from hdpi to xhdpi and two things happended 1) images a bit crispier 2) the images loads faster. developer.android.com/guide/practices/screens_support.html – java Jan 21 '16 at 19:50
  • Oops. I'll correct it. – Tamoghna Chowdhury Jan 22 '16 at 2:07
1

Displaying a smaller image than the device is capable of is not going to "deteriorate" the quality of the image, it's just not going to be as good as what the device is capable of. The example image (2310 x 1300) you state should certainly appear "better" on the S6 than the SIII since the image is larger than what the SIII can display so must be scaled down. The S6 is capable of displaying all the image.

The fact that you cannot see the difference is probably simply down to your eyesight. Between 306ppi (SIII) and 577ppi (S6) and depending on the type of media being consumed, the average human at average viewing distances is probably not going to be able to tell the difference. 577ppi is getting close to what the human eye is capable of differentiating (at 4 inches)!

  • Upscaling an image can reduce the quality of it, by making sharp edges blurry, and sometimes by sampling artefacts, but this is only a concern for "synthetic" images (logos, screen layouts), because photos don't tend to have those sharp single-pixel edges anyway. – Dan Hulme Jan 20 '16 at 16:19
  • @DanHulme , precisely what I pointed out in my addend answer. – Tamoghna Chowdhury Jan 20 '16 at 16:24
  • 1
    @DanHulme Although when upscaling on a very high (577) ppi screen any blurring is going to be negligible and probably not discernable to the average human eye. – MrWhite Jan 20 '16 at 16:27
  • 1
    OTOH, if you did start out with a, say, 640x480 image, it would look very bad indeed on a 2K display, far worse than how it would look on a HD one. There is the amount of upscaling to consider. Blurring will be heavily noticeable, and if the scaling isn't smooth, you can end up aliasing (jaggies). – Tamoghna Chowdhury Jan 20 '16 at 16:34
  • How many Android games are upscaled and look horrendous on a 2K display is a topic for another time. – Tamoghna Chowdhury Jan 20 '16 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.