Why and how should you resize images for different devices?

ProcrustesPR

Resizing images for different devices helps balance clarity, loading speed, and layout stability. Simply displaying a large image at a smaller size on a phone is not enough. First determine how much space the image occupies in the layout, then account for the device pixel ratio and prepare image files in different sizes for the browser to choose from. Reserve space for the image in the layout as well. Images often account for a large share of a webpage’s data transfer, so delivering a version that matches display needs helps avoid unnecessary downloads.

ProcrustesPRProcrustesPRHow Should a CMS Handle Images? From Upload Optimization to Descriptions and URL Management

Start with the display space, then decide on image dimensions

Screen size is not the same as an image’s display size. When choosing dimensions, start with the actual width and height of the area that holds the image—its container—then factor in the device pixel ratio (DPR). In web.dev’s example, an image is displayed in a 500 × 500 pixel container. Setting aside other variables, the image dimensions needed are:

  • DPR of 1: Use a 500 × 500 pixel image file as the baseline.
  • DPR of 2: The ideal source dimensions are 1000 × 1000 pixels.
  • DPR of 3: The ideal source dimensions are 1500 × 1500 pixels.

This does not mean every image must be provided at the highest resolution. web.dev also notes that, in most cases, the higher resolution provided for DPR 3 may not produce a visible improvement. An image slightly smaller than the ideal dimensions may show no perceptible loss of quality for most users. Check how the image actually looks rather than simply pursuing higher pixel counts.

Provide smaller image files, not just a smaller display size

CSS can use percentages or viewport-relative units to adjust an image’s display size for different screens. However, CSS changes the display dimensions, not the actual file size: a smaller image on screen does not mean a smaller download.

To make downloaded images better match display needs, create multiple sizes of the same image and then use responsive image settings:

  • srcset: Lists candidate image files in different sizes for the browser to choose from.
  • sizes: Works with a srcset that uses width descriptors to tell the browser the image’s display width under different conditions.
  • picture: Provides different image versions and can also offer an alternative format when the browser does not support a particular format.

Google’s image documentation also recommends retaining a fallback img element with a src attribute. Preparing multiple image versions and adjusting CSS work together: the image versions give the browser suitable files to download, while CSS controls how the image appears in the layout.

Reserve space with the right aspect ratio and check across devices

Planning image dimensions also means reserving space before an image loads. Images without specified widths and heights may push other content around when they load. For example, a reader may have just started reading when an image below the heading appears, suddenly shifting the text downward. Set width and height, or use CSS aspect-ratio to reserve space with the appropriate proportions and reduce this kind of shift.

Then check across different phones, tablets, and viewport widths: Is the image clear? Does its size suit the layout? Does it push text around while loading? Do not assume other devices will display the page the same way just because the desktop version looks right.

ProcrustesPRProcrustesPRHow should images of different sizes on the same website be named?

Image resizing: perspectives from across the web

When manually adjusting images, how should you balance cropping and compression?

Cropping and compression address different needs: cropping determines which parts of the image to keep, while compression helps control file size. You can first resize an image to suit its display needs, then crop it while retaining important areas and check its clarity. When compressing, balance file size against an acceptable level of image quality. Lossy compression may reduce quality, and the compression method you use also affects the result.

Do website images have to stay below a fixed pixel limit?

There is no need to treat a single number as a hard limit for all images. Some articles suggest that a maximum dimension of around 2,500 pixels is usually sufficient for general website images, but the actual requirements still depend on the image’s purpose, container, device, and viewport. Photography or fashion websites may have a greater need for images with higher pixel counts, while thumbnails may be better suited to lower resolutions.

When planning a layout, what should you consider beyond current devices?

Consider potential future content types and display sizes, as well as situations where images may be embedded in or shared to other containers. When content does not fit the available space, images may extend beyond their frames or appear too small to make out. Add templates where necessary to accommodate different needs and reduce the likelihood of having to redesign the layout as requirements expand.

ProcrustesPRHow many image variants should you prepare, and how should you manage them?

References

  1. 圖片搜尋引擎最佳化 (SEO) 最佳做法 | Google 搜尋中心  |  Documentation  |  Google for Developersdevelopers.google.com — Source used in the article above.
  2. Image performanceweb.dev — Source used in the article above.
  3. Image SEO: How to Optimize Images for Search Engines & Userswww.semrush.com · 2020-07-14T11:00:00Z — Discusses: Do website images have to stay below a fixed pixel limit?
  4. Which Comes First? Layout or Content?www.nngroup.com · 2015-10-11T16:00:01+0000 — Discusses: When planning a layout, what should you consider beyond current devices?
  5. Image SEO: Tips for Image Optimizationneilpatel.com · 2024-11-26T20:00:00+00:00 — Discusses: Do website images have to stay below a fixed pixel limit?
  6. CLS 是什麼?CLS 評分標準、優化 4 方法一次看welly.tw · 2025-02-24T07:49:43.232Z — Source used in the article above.
  7. Image SEO: Optimizing images for search enginesyoast.com · 2026-09-12T12:00:00+00:00 — Source used in the article above.
  8. 加速 Google Web Vitals 重要指標 LCP 的五種方法tenten.co · 2021-08-18T21:46:13.000Z — Discusses: Do website images have to stay below a fixed pixel limit?
  9. SEO網站優化技巧,為網站創建友好的圖像,加快網站讀取速度ithelp.ithome.com.tw — Discusses: When manually adjusting images, how should you balance cropping and compression?
  10. 圖片也可以提升網站曝光?圖片 SEO 必學 8 技巧!welly.tw · 2024-08-09T07:43:16.259Z — Discusses: When manually adjusting images, how should you balance cropping and compression?
  11. Cumulative Layout Shift: What It Is & How to Improve Your Scorewww.semrush.com · 2024-04-26T09:59:00Z — Source used in the article above.

Related articles

How Should a CMS Handle Images? From Upload Optimization to Descriptions and URL ManagementHow should images of different sizes on the same website be named?How many image variants should you prepare, and how should you manage them?How do visual and short-form video trends in search results affect SEO?How can photography websites use SEO to increase visibility and attract clients?How can service and e-commerce websites improve search visibility? Start by distinguishing local needs from buying intentWhy optimize a website, and which tasks can be done for free?How can you use search results page features to attract traffic?
ProcrustesPR
ProcrustesPR