为什么有多种图像尺寸

发布于 2024-11-16 22:48:25 字数 87 浏览 4 评论 0原文

我试图理解具有多种图像尺寸的原因。我知道有不同尺寸和不同密度的屏幕,但是只拥有最大分辨率的图像并将其加载到您需要的尺寸而不是拥有大量不同的图像不是可以接受的吗?

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 rather than have lots of different images?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

╭⌒浅淡时光〆 2024-11-23 22:48:25

缩放图像比仅加载预渲染图像需要更多的处理能力。此外,与一开始就以正确尺寸正确渲染的算法相比,天真的/简单的图像缩放算法看起来质量相当低。

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.

油焖大侠 2024-11-23 22:48:25

我想你可以,但是

  • 带宽
  • 原始图像的
  • 大小计算开销又如何呢?

You could, I suppose, but what about

  • Bandwidth
  • Size of original image
  • Computational overhead
小瓶盖 2024-11-23 22:48:25

你说得对,这是可以接受的。
与往常一样,这只是以速度换取磁盘空间。
您决定是增加尺寸还是在运行时调整图形大小……这取决于您的用例。

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.

伴随着你 2024-11-23 22:48:25

这是因为您不必一遍又一遍地处理长文件,想象一下您网站上的许多访问者都请求相同的图像,他们具有不同的分辨率,最好使用不同的图像,而不是处理最大的图像每个请求都会有一个新请求,这是因为服务器端的性能以及您站点中的重要并发性,这可能会给堆空间带来问题,您必须关心数据处理性能。有时您必须在堆空间、处理器和数据空间资源之间进行选择。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文