JA EN

Creating Retina Display-Ready Images - Achieving Sharp Display on High-DPI Screens

· 9 min read

Why Images Appear Blurry on Retina Displays - Understanding Device Pixel Ratio

Retina displays (Apple trademark) and high-DPI screens render one CSS pixel using multiple physical pixels. This ratio is called Device Pixel Ratio (DPR). On DPR 2 displays, one CSS pixel is drawn with 2x2 = 4 physical pixels.

Why images appear blurry:

Current major device DPRs: iPhone 15/16 series DPR 3, MacBook Pro/Air Retina DPR 2, iPad Pro DPR 2, Samsung Galaxy S series DPR 2.625-3.5, typical Windows laptops DPR 1.25-2, 4K monitors at 150% scaling DPR 1.5. Get current DPR via window.devicePixelRatio in JavaScript or @media (min-resolution: 2dppx) in CSS.

Resolution Switching with srcset - Basic HTML Implementation

HTML's srcset attribute lets browsers automatically select optimal resolution images based on device DPR. Developers provide multiple resolution images, delegating selection to browsers for optimal delivery per device.

Basic syntax: <img src="image-1x.jpg" srcset="image-1x.jpg 1x, image-2x.jpg 2x, image-3x.jpg 3x" alt="description" width="300" height="200">

This delivers image-1x.jpg (300x200px) to DPR 1, image-2x.jpg (600x400px) to DPR 2, and image-3x.jpg (900x600px) to DPR 3 devices.

Width-based specification with w descriptor: <img srcset="image-300w.jpg 300w, image-600w.jpg 600w, image-900w.jpg 900w" sizes="(max-width: 600px) 100vw, 300px" alt="description">

The sizes attribute tells browsers the image's display width. Browsers combine this with DPR to select optimal images. With sizes="300px" on DPR 2, the 600w image is selected.

Implementation notes: Always set src as fallback for non-srcset browsers. Specify width and height to prevent layout shift (CLS). Browsers may select lower-resolution images based on cache state or network speed (browser optimization decisions).

Picture Element and Art Direction - Device-Specific Image Delivery

The <picture> element provides finer control than srcset, delivering entirely different images based on device characteristics. Called "art direction," it serves images with different compositions or crop positions rather than just resolution switching.

Art direction delivers different compositions for mobile (portrait crop) and desktop (landscape panorama) while providing DPR-appropriate resolutions for each, plus WebP format for supported browsers with JPEG fallback.

Cases requiring art direction:

<picture> element's <source> elements are evaluated top-to-bottom, using the first matching condition's image. If no conditions match, the <img> element serves as fallback. This enables sophisticated multi-axis optimization combining viewport size, DPR, and format support in a single declaration.

CSS High-DPI Support - image-set() and Background Image Optimization

CSS background and content images also need high-DPI display support. The image-set() function enables CSS-level image switching based on device DPR.

Basic image-set() syntax enables specifying multiple resolutions and formats for background images, with browsers selecting the appropriate version based on device capabilities.

As of 2026, image-set() is supported across all major browsers. For older browser fallback, media query approaches work alongside: @media (min-resolution: 2dppx) to serve 2x background images.

SVG backgrounds eliminate resolution switching entirely. As vector format, SVG displays crisply at any DPR. Actively use SVG for icons, logos, and pattern backgrounds to avoid preparing multiple resolution images.

CSS border-image and mask-image also need high-DPI support. When representing 1px borders with images, DPR 2 requires 2px images. Address with image-set() or media queries similarly.

Image Export Workflow - Efficient Multi-Resolution Generation

Building efficient workflows for generating Retina-ready images directly reduces operational costs. Manual multi-resolution export is impractical, making automation pipelines essential.

Recommended workflow:

Export settings guide: 1x at display size (JPEG 80-85, WebP 75-80), 2x at double (JPEG 70-75, WebP 65-70 - slightly lower quality for larger size), 3x at triple (JPEG 65-70, WebP 60-65). High-resolution images tolerate lower quality settings because dense physical pixels mask visual degradation. 2x at quality 70 often appears equivalent to 1x at quality 85 on DPR 2 displays.

Balancing Performance - Managing High-DPI Support Costs

High-DPI support directly improves image quality but incurs file size costs. 2x images have approximately 4x pixels (area ratio), 3x approximately 9x, severely impacting page load speed without proper optimization.

Performance maintenance strategies:

Monitor Core Web Vitals impact with Lighthouse and PageSpeed Insights, regularly verifying image sizes don't negatively affect LCP scores.

Related Articles

Responsive Images Implementation Guide - Complete Guide to srcset, sizes, and picture Elements

Learn how to serve optimal images based on device screen size and resolution with detailed code examples for responsive image implementation.

Image Lazy Loading Implementation Guide - Choosing Between loading=lazy and IntersectionObserver

Learn how to improve web page initial load speed with image lazy loading, covering both native API and JavaScript approaches with practical examples.

Art Direction for Device-Specific Image Delivery - Practical Use of picture Element and media Attribute

Master responsive image art direction techniques. Use the picture element with media attributes to serve optimally composed images per device, balancing user experience and performance.

Web Image Optimization Checklist - 15 Actionable Items for Production

A comprehensive 15-item checklist for web image optimization. Concrete techniques and priorities that directly improve Core Web Vitals scores.

WebP Advantages and Browser Support - Next-Gen Image Format

Learn about WebP format benefits, drawbacks, and browser compatibility. Everything you need to decide whether to migrate from JPEG and PNG.

Web Image Performance Audit - Practical Guide to Core Web Vitals Improvement

Learn how to audit image impact on web performance. Covers LCP improvement, CLS prevention, and transfer size reduction with actionable techniques.

Related Terms