Hi everyone,
I have a huge doubt and I can't find an answer. Through books and tutorials I learned that I need to provide different sized images for each resolution. In this way images appear the same across devices with different numbers of pixels on the screen. For example, an image in drawable-hdpi folder must be 1,5x greater than the same one provided in drawable-mdpi and so on. All of this thanks to Density-independent pixel system. That's ok but...how can I choose the correct dimensions of my image source (base image)? Taking as example this layout from Material Design Guidelines:
Suppose the image showed has a fixed height and a width set in match_parent. I want to replicate this kind of layout with my own image. If I download an image from free stock photos website or take an image with my reflex, most probably I’ll get a very big picture, such as 5184x3456 px. I think an image like this is too big as source image. If I use such big image for mdpi drawable, the image for xxxhdpi drawable will be 4 times greater! Not to mention the weight!
I tried to do the following reasoning: a device like Nexus 5 has 1920x1080 resolution screen and it's classified as xxhdpi device. My idea is to resize the image to obtain a width equal to about the length of the longest axis, (y-axis, 1920px, because the device can be rotated). In this way I would have to obtain a lighter base image without a high number of unnecessary pixels.
Could you help me understand what the procedure is?
Thank for the attention