网页设计 - jpg 或 png,哪一种最适合网页

发布于 2024-08-10 10:26:25 字数 1431 浏览 5 评论 0原文

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

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

发布评论

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

评论(6

蓝色星空 2024-08-17 10:26:25

这取决于。

PNG 更适合颜色数量较少的清晰图像,

JPG 更适合低带宽图像 - 但它不那么清晰,因此不太适合 GUI。

一般来说,JPG 用于照片和图片,而 PNG(或 GIF)用于布局。

您可能会发现此页面很有趣,因为它介绍了PNG 与 GIF。

It depends.

PNG is better for crisp images with a low number of colours,

JPG is better for a low-bandwidth image - however it is not as crisp and therefore not very good for GUI.

Generally, JPG is for photos and pictures, whereas PNG (or GIF) is for layout.

You may find this page interesting, as it goes over the basics of PNG vs GIF.

深海里的那抹蓝 2024-08-17 10:26:25

Google has written about it very well. From Selecting the right image format, you can find a flow-chart to make the decision:

Selecting the right image format

话少情深 2024-08-17 10:26:25

鉴于平均网络连接速度不断提高,我不认为页面加载时间不再是一个令人担忧的问题[鸭子!];考虑一下您试图利用您拥有的资源实现什么目标确实更有用:例如,带宽是否有限?那么倾向于更重的压缩是理所当然的。网站的图形内容是否会扩展,确保服务器空间的成本会随着时间的推移而增加?然后倾向于更重的压缩将延迟该成本。这是一个艺术作品集网站吗?然后——啊哈! -- 采样器工作中的压缩伪影实际上可能是理想的!你想鞭打游戏吗?那么屏幕截图可能会非常清晰。

一般来说,我会重复已经说过的话,尽管语言可能略有不同:对于网站陈设,它们往往是计算机生成的,并且将被缓存以便在页面之间重复使用,倾向于.png;对于网站内容,通常是特定于页面的,并且可能足够大且复杂以掩盖有损压缩,因此倾向于使用jpg。

具体参考您认为合适的地方切换到 png,当然,通过 PNGCrush 运行所有内容 - 否则它们不会以您期望的颜色在每个浏览器中显示,并且设计的整体质量将会降低。

Given the ever-rising speed of the average net connection I don't tend to think that page loading time is much of a concern any more [ducks!]; It's really far more useful to think about what you are trying to achieve with the resources you have at your end: For example is bandwidth limited? Then tending towards heavier compression is a no-brainer. Is the graphic content of the site going to expand, ensuring that the cost of server space will increase over time? Then tending towards heavier compression will delay that cost. Is it an art portfolio site? Then -- aha! -- compression artefacts in the sampler work may actually be desirable! Are you trying to flog a game? Then the screenshots should probably be ultra-crisp.

Generally, then, I would repeat what has been said, although perhaps in slightly different language: For site furnishings, which tend to be computer-generated and will be cached for re-use between pages, tend towards png; For site content, which will often be page-specific and likely large and complex enough to mask lossy compression, tend towards jpg.

With specific reference to switching to png where you decide it is appropriate, run everything through PNGCrush as a matter of course -- otherwise they won't get displayed with the colours you expect in every browser and the overall quality of your design will be diminished.

栖竹 2024-08-17 10:26:25

“鉴于平均网络连接速度不断提高,我认为页面加载时间不再是一个重要问题”

根据网站 SEO 优化,如果页面加载时间高于 2,Google 会对您的网站排名较差秒,因此压缩是必要的,尤其是在图形较多的新网站设计中。

"Given the ever-rising speed of the average net connection I don't tend to think that page loading time is much of a concern any more "

According to the website SEO optimisation, Google rank your website worse if page load time is above 2 seconds, so compression is necessary, especially on new website designs heavy on graphics.

转身以后 2024-08-17 10:26:25

jpg 通常更适合具有许多细微不同颜色的摄影图像。 png 与计算机生成的图形配合良好。

这是我的经验法则。

jpg is usually preferred for photographic images that have a lot of subtly different colors. png works well with computer generated graphics.

That's my rule of thumb.

荒芜了季节 2024-08-17 10:26:25

我是一个初学者,我所做的主要是如果图像太大,我会变小,除非它是背景图像。如果是为了布局,我会选择 PNG 和 JPG 图片。

I am a starter and mostly what I do is if the image is too big I make small unless it's a background image. And if it is for layout I choose PNG and JPG for pictures.

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