A fictional image-set offers hero-1x.png 1x and hero-2x.png 2x; the user agent selects one candidate for the current environment. Separately, image-resolution:300dpi says how many image pixels represent one CSS length unit when deriving the chosen raster image’s natural size. Changing the property need not select a different URL, and changing the selected URL need not change an explicit property value.
This lesson continues The Gold Standard of Websites, the Gold Standard of Education and the How X Works hub. Every filename, pixel dimension, metadata density, dppx or dpi value, device scale and natural-size calculation is an original synthetic fixture. The lesson does not promise support, convert density labels into a source-order fallback or resolve the specification’s open interaction note beyond the cited text.
Record the candidate list before and after type and duplicate filtering, each candidate resolution, selection environment, selected URL, decoded pixel dimensions, embedded metadata, image-resolution specified and computed values, snap adjustment, derived natural dimensions, used element size, request outcome and browser build.
The CSS Images Module Level 4 defines image-set() candidate negotiation and the image-resolution property. Its image-resolution section retains an open interaction question about images whose resolution was set by CSS, so this lesson preserves that draft uncertainty and does not invent a settled precedence rule.
THE GOLD STANDARD · WEBSITES
image-set() chooses a candidate; image-resolution determines preferred image density
A resolution label inside image-set() participates in filtering and selection among alternative image candidates. The image-resolution property specifies the preferred resolution used for raster images on an element, including an explicit density, image metadata through from-image and optional device-pixel snapping. Candidate choice and natural-dimension calculation are separate stages even when both use dppx or dpi units.
Fast route
Start with the decisive rule.
Start this route
Measurement route
Build the browser state and evidence ledger.
Start this route
Comparison route
Separate the nearest lookalikes.
Start this route
Transfer route
Change the context and retest.
Start this route
Reporting route
State limits and continue reading.
Start this route
Chapter contents
Open the full chapter index
- 1. Name selection and sizing
- 2. Filter candidate types
- 3. Remove duplicate resolutions
- 4. Do not make order a retry chain
- 5. Read explicit image resolution
- 6. Use from-image metadata carefully
- 7. Separate metadata from candidate labels
- 8. Convert units explicitly
- 9. Trace natural dimensions
- 10. Apply snap as a separate step
- 11. Exclude vector images
- 12. Separate selection from fetch success
- 13. Respect inherited property state
- 14. Use an equal-size control
- 15. Preserve the draft interaction gap
- 16. Treat unsupported syntax as unavailable
- 17. Build a density matrix
- 18. Use the owning sources
1. Name selection and sizing
image-set() selects one image candidate; image-resolution contributes to the preferred resolution used to derive natural dimensions. Keep the selected resource and the density interpretation in different fields.
Original worked example. A 2x file is selected while image-resolution remains an explicit 300dpi. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Hold the URL fixed and change only the property. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record selected URL before computing natural size. If this check fails, mark the claim unavailable and repair the method before continuing.
Keep specified grammar, source data, computed value, used geometry or scheme and final paint in separate fields so a later stage cannot rewrite an earlier one.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
2. Filter candidate types
Unsupported type() annotations remove candidates before resolution selection. image-resolution does not restore an option removed by type filtering.
Original worked example. An unsupported AVIF 2x option is removed, leaving a PNG 1x candidate. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Mark AVIF supported in a second environment. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Archive pre-filter and post-filter lists. If this check fails, mark the claim unavailable and repair the method before continuing.
Use a positive case, a clean negative case and an unavailable case. Unavailable means the required syntax, resource or observation was not established.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
3. Remove duplicate resolutions
Later image-set candidates with the same resolution as an earlier candidate are removed by the set-processing rules.
Original worked example. Two 2x options leave the first 2x entry. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Change the second to 3x. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Preserve source order and resolved densities. If this check fails, mark the claim unavailable and repair the method before continuing.
Change one consequential premise while holding the rest fixed, predict the new branch before inspection and preserve any disagreement.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
4. Do not make order a retry chain
The user agent chooses among remaining candidates using resolution and other relevant conditions; ordering is not a guaranteed network fallback sequence.
Original worked example. A dense display can choose the second 2x option. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Throttle the network without reordering. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record the selection environment. If this check fails, mark the claim unavailable and repair the method before continuing.
Carry one plausible rival explanation through the ledger and name the next observation that would distinguish it.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
5. Read explicit image resolution
An explicit image-resolution value states preferred image pixels per CSS length unit and can override misleading embedded density metadata.
Original worked example. A 1500px image at 300dpi has a five-inch natural width. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Change only the property to 150dpi. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Show pixels divided by pixels per inch. If this check fails, mark the claim unavailable and repair the method before continuing.
Archive exact declarations, resource bytes or metadata, computed styles, geometry, preference state and browser version.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
6. Use from-image metadata carefully
from-image asks for the natural resolution recorded by the image format; if metadata is absent, an explicit fallback or 1dppx applies.
Original worked example. A file declares 150dpi and produces a ten-inch natural width. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Remove the metadata bytes. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record metadata presence and accepted value. If this check fails, mark the claim unavailable and repair the method before continuing.
State editor-draft, deprecated, optional or at-risk status accurately and keep essential content usable when experimental visual behavior is absent.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
7. Separate metadata from candidate labels
An image-set 2x label is CSS candidate data, while EXIF or format density belongs to the resource. They can disagree and must not be silently merged.
Original worked example. The selected file is labelled 2x but embeds 300dpi. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Change only the embedded metadata. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Store candidate and file metadata independently. If this check fails, mark the claim unavailable and repair the method before continuing.
Keep specified grammar, source data, computed value, used geometry or scheme and final paint in separate fields so a later stage cannot rewrite an earlier one.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
8. Convert units explicitly
1dppx equals 96dpi in CSS resolution units. Convert before comparing values expressed in different units.
Original worked example. 2dppx equals 192dpi. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Compare with 75dpcm after conversion. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Preserve original units and normalized values. If this check fails, mark the claim unavailable and repair the method before continuing.
Use a positive case, a clean negative case and an unavailable case. Unavailable means the required syntax, resource or observation was not established.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
9. Trace natural dimensions
Preferred resolution affects a raster image’s natural dimensions; it does not rewrite the decoded pixel array.
Original worked example. A 960px-wide file at 2dppx has a 480 CSS-pixel natural width. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Set 1dppx. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record decoded pixels and natural CSS size separately. If this check fails, mark the claim unavailable and repair the method before continuing.
Change one consequential premise while holding the rest fixed, predict the new branch before inspection and preserve any disagreement.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
10. Apply snap as a separate step
The snap keyword adjusts a preferred resolution so one image pixel maps to an integer number of device pixels. It is not candidate selection.
Original worked example. A requested 300dpi snaps to a nearby mapping on a 96dpi device. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Change the device resolution. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Save pre-snap and used resolution. If this check fails, mark the claim unavailable and repair the method before continuing.
Carry one plausible rival explanation through the ledger and name the next observation that would distinguish it.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
11. Exclude vector images
Vector images lack a natural raster resolution, so image-resolution has no effect on them under the draft. image-set can still select a vector candidate by its own rules.
Original worked example. An SVG is selected but its vector geometry supplies sizing. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Replace it with PNG. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record resource type before applying density arithmetic. If this check fails, mark the claim unavailable and repair the method before continuing.
Archive exact declarations, resource bytes or metadata, computed styles, geometry, preference state and browser version.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
12. Separate selection from fetch success
A candidate can be selected and then fail to fetch or decode. image-resolution cannot turn failed bytes into an available image.
Original worked example. The chosen 2x URL returns invalid data. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Serve valid PNG bytes at the same URL. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Archive selection, response and decode stages. If this check fails, mark the claim unavailable and repair the method before continuing.
State editor-draft, deprecated, optional or at-risk status accurately and keep essential content usable when experimental visual behavior is absent.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
13. Respect inherited property state
image-resolution is inherited and applies to raster images used in or on the element; a candidate label remains attached to its image-set option.
Original worked example. A child inherits 300dpi from a parent. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Override the child to 1dppx. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record cascade and computed property value. If this check fails, mark the claim unavailable and repair the method before continuing.
Keep specified grammar, source data, computed value, used geometry or scheme and final paint in separate fields so a later stage cannot rewrite an earlier one.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
14. Use an equal-size control
Different pairs of candidate resolution and image-resolution can yield the same final displayed size. Pixel equality does not identify which stage supplied the density.
Original worked example. A 2x candidate at one property value matches a 1x candidate under another. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Inspect the selected URL and computed value. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Require both network and style evidence. If this check fails, mark the claim unavailable and repair the method before continuing.
Use a positive case, a clean negative case and an unavailable case. Unavailable means the required syntax, resource or observation was not established.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
15. Preserve the draft interaction gap
The current draft explicitly asks how image-resolution should interact with image-set-derived natural resolution. Do not present one browser result as a settled cross-browser law.
Original worked example. Two implementations choose different precedence. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Repeat after a specification revision. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Quote the draft status and version in the evidence record. If this check fails, mark the claim unavailable and repair the method before continuing.
Change one consequential premise while holding the rest fixed, predict the new branch before inspection and preserve any disagreement.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
16. Treat unsupported syntax as unavailable
A rejected image-resolution declaration leaves the cascade’s earlier or initial value. That is fallback, not proof that the requested density was used.
Original worked example. The initial 1dppx applies. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Test a build that supports from-image snap. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Record parsing, cascade and computed value. If this check fails, mark the claim unavailable and repair the method before continuing.
Carry one plausible rival explanation through the ledger and name the next observation that would distinguish it.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
17. Build a density matrix
Cover type filtering, duplicate resolutions, device scale, explicit densities, metadata present and absent, snap, vector images, failed decoding, inheritance and the open interaction case.
Original worked example. Each row carries candidate and preferred-resolution ledgers. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. Repeat for print media. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Version images, metadata, CSS and browser. If this check fails, mark the claim unavailable and repair the method before continuing.
Archive exact declarations, resource bytes or metadata, computed styles, geometry, preference state and browser version.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Previous chapter · Contents · Next chapter
18. Use the owning sources
CSS Images Level 4 owns candidate negotiation and preferred resolution; Level 3 constrains metadata use; CSS Values owns resolution units.
Original worked example. The route follows filter, choose, fetch, decode, resolve density and derive natural size. The declarations, values and observations are explicit so the reader can reconstruct the decision instead of trusting a label.
Changed-context transfer. When the draft resolves its open issue, rerun the matrix. State what changed, predict the consequence and revise only the conclusion that depended on that condition.
Practical evidence check. Save exact source URLs, access date and raw calculations. If this check fails, mark the claim unavailable and repair the method before continuing.
State editor-draft, deprecated, optional or at-risk status accurately and keep essential content usable when experimental visual behavior is absent.
Before closing, reconcile the fixture against the chapter rule: identify the parsed declaration, source data, computed state, paint result and first missing obligation; change one condition and preserve the raw trace beside the revised result. End the chapter with three sentences: what the evidence establishes, what it does not establish and what observation would change the conclusion. This keeps the lesson useful when the browser, stylesheet, resource or preference state changes. A strong record also names the datum, denominator, section or coordinate system that governed the decision, so a later reader can repeat the reasoning without importing an unstated shortcut.
Grouped reading routes
Core route
Companion lessons
- Separating stripes() One-Dimensional Allocation from repeating-linear-gradient() Two-Dimensional Repetition
- Separating image-orientation Metadata Handling from CSS transform Rotation
- Separating contrast-color() Foreground Choice from light-dark() Scheme Choice
Related specialist lessons
Sources and further study
CSS Images Module Level 4. Used for the standard definitions, material mechanisms or method limits developed in this lesson.
CSS Images Module Level 3 metadata rules. Used for the standard definitions, material mechanisms or method limits developed in this lesson.
CSS Values and Units Module Level 4. Used for the standard definitions, material mechanisms or method limits developed in this lesson.
The worked examples and transfer checks are developed here and state their own assumptions. The linked sources support the underlying CSS grammar, image, color, geometry and rendering principles.
Return to contents · Return to The Gold Standard of Websites