why have multiple image sizes
I am trying to understand the reason for having multiple image sizes. I know there are different size screens with different densities, but wouldn't it be acceptable to just have the largest resolution image and load it to the size you need rat开发者_运维技巧her than have lots of different images?
Scaling an image takes considerably more processing power than just loading a pre-rendered one. Also, a naive/simple image scaling algorithm would look pretty low quality compared to one that had been actually properly rendered at the right size in the first place.
You could, I suppose, but what about
- Bandwidth
- Size of original image
- Computational overhead
You are right it is acceptable. As always this is just about trading speed for disk space. You decide if you increase the size or have your graphics resize at runtime... it depends on your usecase.
It is because you do not have to be processiing a long file over and over again, imagine lots of visitors onto your site all of them requesting the same image they have different resolutions is better to have different images instead being processing the largest image to have a new one for each request, this is because of performance on the server side with an important concurrency in your site this may carry issues for the Heap Space you must care about data process performance. some times you have to choose in between resources Heap Space, Processor and DataSpace.
精彩评论