How do you serve sharp images on Retina and other high-DPI screens?

Serve an image source with enough intrinsic pixels for its rendered CSS size and the display’s pixel density. A 300 CSS-pixel image on a ratio-2 screen can use a 600-pixel source for full density. Responsive image candidates let the browser balance sharpness, bytes and cache state.
For a fixed-size asset, provide density descriptors:
<img
src="logo-160.png"
srcset="logo-160.png 1x, logo-320.png 2x"
width="160"
height="48"
alt="Company name">
For fluid photographs, use width descriptors and sizes so the browser can calculate the required effective density at each layout width. Supply several optimized candidate widths. One enormous source wastes data, and compression matters as much as pixel dimensions.
Use SVG for suitable logos, diagrams and icons because vector shapes remain sharp across densities. Do not convert detailed photographs to SVG. Canvas content needs a higher-resolution backing store scaled to its CSS dimensions, and may need to update when zoom or display density changes.
Inspect real rendering, currentSrc and transfer size on standard and high-DPI displays. Extra density has diminishing visual benefit and can consume memory, decoding time and data. Avoid automatically serving 3x assets when a well-compressed 2x candidate looks identical at the intended viewing size. Recheck the pattern after typography, spacing or browser-support changes. Shared token updates can revive overflow, so the test should use the limiting content state instead of an ideal screenshot. Keep the layout rule beside the component and document why the threshold or constraint exists. This reduces accidental overrides and gives future editors a concrete condition to retest after content changes.