CSS dynamic-range-limit Property
The dynamic-range-limit property controls the maximum luminance permitted when displaying High Dynamic Range (HDR) content.
It allows web developers to limit unusually bright highlights in HDR images and video, helping maintain a comfortable visual balance between HDR and Standard Dynamic Range (SDR) content. The property is particularly useful for image galleries, media previews, and interfaces that combine different types of visual content.
Unlike conventional brightness adjustments, dynamic-range-limit controls the available HDR luminance range rather than applying a uniform brightness filter.
dynamic-range-limit Syntax
The dynamic-range-limit property accepts three predefined keywords or a value produced by the dynamic-range-limit-mix() function.
Basic Syntax
selector {
dynamic-range-limit: standard;
}
Keyword Values
.hdr-image {
dynamic-range-limit: standard;
}
.hdr-image {
dynamic-range-limit: constrained;
}
.hdr-image {
dynamic-range-limit: no-limit;
}
Function Value
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 70%, no-limit 30%);
}
CSS-Wide Keywords
.hdr-image {
dynamic-range-limit: inherit;
}
.hdr-image {
dynamic-range-limit: initial;
}
.hdr-image {
dynamic-range-limit: unset;
}
.hdr-image {
dynamic-range-limit: revert;
}
.hdr-image {
dynamic-range-limit: revert-layer;
}
The initial value is no-limit, allowing the display system to use its available HDR brightness range.
Property Values
The following values determine the maximum permitted HDR luminance.
| Value | Description |
|---|---|
standard |
Limits maximum luminance to HDR reference white, equivalent to the brightness of standard CSS white. |
constrained |
Allows some additional HDR brightness while limiting the intensity of highlights. |
no-limit |
Allows substantially greater luminance than HDR reference white, subject to device and browser capabilities. |
dynamic-range-limit-mix() |
Creates a custom luminance limit by combining predefined values in specified proportions. |
CSS-Wide Values
| Value | Description |
|---|---|
inherit |
Uses the computed value inherited from the parent element. |
initial |
Restores the initial value, no-limit. |
unset |
Uses the inherited value because the property is inherited. |
revert |
Reverts the property according to the CSS cascade origins. |
revert-layer |
Reverts the property according to the CSS cascade layers. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | no-limit |
| Inherited | Yes |
| Applies to | All elements |
| Computed value | Specified keyword or normalized dynamic-range-limit-mix() value |
| Animation type | Interpolation through dynamic-range-limit-mix() |
| Percentages | Not applicable directly; percentages are used inside dynamic-range-limit-mix() |
The exact luminance associated with constrained and no-limit is intentionally not specified as a fixed brightness measurement. The displayed result depends on the HDR content, hardware, operating system, and browser.
How It Works
HDR content can contain highlights brighter than the reference white used for standard web content. The dynamic-range-limit property establishes a maximum permitted brightness for rendering that content.
Step 1: Display HDR Content
<img class="hdr-preview" src="images/hdr-example.jpg" alt="HDR photograph with bright highlights">
The image must contain HDR information for the property to produce a meaningful visual difference.
Step 2: Apply a Limit
.hdr-preview {
dynamic-range-limit: constrained;
}
The browser limits the maximum HDR luminance to a level intended to remain comfortable alongside SDR content.
Step 3: Allow Full HDR Brightness
.hdr-preview.is-expanded {
dynamic-range-limit: no-limit;
}
When the image is expanded, the browser can use a greater portion of the display's HDR brightness capability.
Important Distinction
The property establishes a luminance limit. It does not guarantee a particular physical brightness, and it cannot create HDR detail in content that does not contain it.
Understanding HDR and SDR
HDR and SDR describe different ranges of luminance available for displaying visual content.
Standard Dynamic Range (SDR)
SDR content uses a conventional brightness range. Standard CSS white, represented by #ffffff, serves as the HDR reference white level when comparing SDR and HDR content.
High Dynamic Range (HDR)
HDR content can contain highlights that appear brighter than standard reference white on compatible displays.
HDR Headroom
HDR headroom describes how much brighter a display can become above reference white. It is commonly expressed in photographic stops, with each additional stop representing a doubling of luminance.
Why Brightness Differences Matter
An HDR photograph displayed beside ordinary interface elements may contain highlights that are noticeably brighter than the surrounding content.
Limiting HDR luminance can make mixed-content interfaces more visually consistent.
Important Consideration
HDR capabilities vary among devices. A display without HDR headroom may show little or no visible difference between the available dynamic-range-limit values.
standard
The standard value limits the maximum luminance to HDR reference white.
Basic Example
.hdr-image {
dynamic-range-limit: standard;
}
Image Gallery Example
.gallery img {
dynamic-range-limit: standard;
}
How It Works
HDR highlights are prevented from exceeding the reference white luminance level.
Practical Uses
This value is useful for thumbnails, small previews, and interfaces where bright HDR highlights would distract from surrounding content.
Important Consideration
Using standard does not convert the source image into an SDR file. It limits the luminance permitted when the image is displayed.
constrained
The constrained value allows some HDR brightness above reference white while restricting the intensity of highlights.
Basic Example
.hdr-image {
dynamic-range-limit: constrained;
}
Media Preview Example
.media-preview {
dynamic-range-limit: constrained;
}
How It Works
The browser permits a moderate amount of HDR headroom rather than limiting the content entirely to reference white.
Practical Uses
Constrained HDR is useful when images should retain some highlight intensity without overwhelming adjacent text, controls, or SDR images.
Important Consideration
The specification does not define one universal brightness level for constrained. Results can differ between displays and implementations.
no-limit
The no-limit value permits HDR content to use the available display brightness range without an additional limit imposed by this property.
Basic Example
.hdr-image {
dynamic-range-limit: no-limit;
}
Expanded Image Example
.image-viewer img {
dynamic-range-limit: no-limit;
}
How It Works
The browser may display HDR highlights substantially brighter than reference white when the content and hardware support that brightness.
Practical Uses
This value is appropriate for dedicated HDR image viewers and other experiences where displaying the available HDR range is intentional.
Important Consideration
no-limit does not bypass operating system settings, user preferences, hardware limitations, or browser rendering restrictions.
dynamic-range-limit-mix()
The dynamic-range-limit-mix() function creates a custom HDR luminance limit by mixing two or more dynamic-range values in specified proportions.
Basic Example
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 70%, no-limit 30%);
}
Mixing Standard and Constrained
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 50%, constrained 50%);
}
Mixing Three Values
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 40%, constrained 40%, no-limit 20%);
}
How Percentages Work
Each percentage determines the relative contribution of its associated dynamic-range value.
When the supplied percentages do not total 100%, they are normalized proportionally.
Normalized Example
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 20%, no-limit 20%);
}
Because the two values have equal weights, the result is equivalent to mixing standard 50% and no-limit 50%.
Nested Functions
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(
standard 60%,
dynamic-range-limit-mix(constrained 50%, no-limit 50%) 40%
);
}
Percentage Restrictions
Individual percentages must be between 0% and 100%. Negative percentages and percentages greater than 100% are invalid.
Important Consideration
The function does not directly specify a brightness value in nits or other physical units. It combines the luminance limits associated with the supplied keywords.
Support for this function is limited, so use a supported keyword fallback when necessary.
HDR Image Galleries
Image galleries are a practical use case because several HDR and SDR photographs may appear together.
Gallery Thumbnails
.photo-gallery img {
dynamic-range-limit: constrained;
}
Expanded Image
.photo-gallery .expanded-image {
dynamic-range-limit: no-limit;
}
Consistent Preview Brightness
Constraining thumbnail luminance can reduce distracting differences between neighboring images.
Dedicated Viewing
When a visitor opens a photograph in a larger viewer, allowing the available HDR range may be more appropriate.
Fallback Behavior
Browsers that do not support the property ignore its declaration. The gallery remains usable, but HDR brightness may not be constrained as intended.
HDR Video
The dynamic-range-limit property can also be applied to video elements containing HDR content.
Basic Example
video {
dynamic-range-limit: constrained;
}
HTML Example
<video class="hdr-video" controls width="480">
<source src="media/hdr-video.mp4" type="video/mp4">
Your browser does not support HTML video.
</video>
.hdr-video {
display: block;
max-width: 100%;
height: auto;
dynamic-range-limit: constrained;
}
Video Previews
Limiting HDR luminance can help keep video previews visually balanced with surrounding page content.
Fullscreen Playback
.hdr-video:fullscreen {
dynamic-range-limit: no-limit;
}
Important Consideration
HDR video rendering depends on the browser, video format, operating system, and display hardware. The property does not guarantee HDR playback support.
Inheritance
The dynamic-range-limit property is inherited, allowing a limit to be applied to an entire section of a page.
Parent Container
.media-gallery {
dynamic-range-limit: constrained;
}
Inherited Behavior
Descendants inherit the parent's computed value unless another declaration overrides it.
Override an Individual Image
.media-gallery {
dynamic-range-limit: constrained;
}
.media-gallery .featured-image {
dynamic-range-limit: no-limit;
}
Explicit Inheritance
.media-gallery img {
dynamic-range-limit: inherit;
}
Important Consideration
Because the property is inherited, setting it on a broad container can affect HDR media throughout that container. Apply overrides where different limits are needed.
Media Queries
The CSS dynamic-range media feature can identify devices capable of displaying HDR content.
Detect HDR Capability
@media (dynamic-range: high) {
.hdr-image {
dynamic-range-limit: constrained;
}
}
Combine with Feature Detection
@supports (dynamic-range-limit: constrained) {
@media (dynamic-range: high) {
.hdr-image {
dynamic-range-limit: constrained;
}
}
}
Video Dynamic Range
@media (video-dynamic-range: high) {
.video-preview {
dynamic-range-limit: constrained;
}
}
Important Distinction
The dynamic-range media feature detects HDR capability, not whether HDR is currently active or whether particular content is being rendered in HDR.
Likewise, support for HDR media queries does not automatically mean the browser supports dynamic-range-limit.
Animations and Transitions
The dynamic-range-limit property supports interpolation through dynamic-range-limit-mix(), allowing compatible browsers to transition between luminance limits.
Basic Transition
.hdr-preview {
dynamic-range-limit: standard;
transition: dynamic-range-limit 0.5s ease;
}
.hdr-preview:hover {
dynamic-range-limit: no-limit;
}
Keyboard Focus
.hdr-preview:hover,
.hdr-preview:focus-visible {
dynamic-range-limit: no-limit;
}
Animation Example
.hdr-preview {
animation: hdr-highlight 3s ease-in-out infinite alternate;
}
@keyframes hdr-highlight {
from {
dynamic-range-limit: standard;
}
to {
dynamic-range-limit: constrained;
}
}
Reduced Motion
@media (prefers-reduced-motion: reduce) {
.hdr-preview {
transition: none;
animation: none;
}
}
Important Consideration
Animated HDR brightness changes may be uncomfortable for some visitors. Avoid unnecessary flashing or repeated brightening, and test transitions on HDR-capable hardware.
Interpolation support is not universal. Unsupported browsers may ignore the property or apply changes without a smooth transition.
dynamic-range-limit vs. filter
The dynamic-range-limit and filter properties can both affect the appearance of images, but they operate differently.
dynamic-range-limit
.hdr-image {
dynamic-range-limit: constrained;
}
Limits the maximum luminance permitted for HDR content.
filter: brightness()
.image {
filter: brightness(0.8);
}
Applies a brightness adjustment to the rendered image, affecting its appearance more generally.
Comparison
| Behavior | dynamic-range-limit | filter: brightness() |
|---|---|---|
| Primary purpose | Limit HDR luminance | Adjust image brightness |
| Designed for HDR headroom | Yes | No |
| Accepts brightness multipliers | No | Yes |
| Inherited | Yes | No |
| Modern browser support | Limited | Widely supported |
Recommended Approach
Use dynamic-range-limit when the goal is to control HDR highlight intensity. Use filter: brightness() for general brightness adjustments.
A brightness filter is not an exact substitute for limiting HDR headroom.
dynamic-range-limit Example
This example provides a live demonstration of the three primary dynamic-range-limit values.
The sample uses an ordinary image URL as a placeholder. Replace it with an HDR image to observe the intended luminance differences on compatible hardware.
HTML Example
<div class="hdr-comparison">
<figure class="hdr-standard">
<img src="images/hdr-example.jpg" alt="HDR sample photograph">
<figcaption>standard</figcaption>
</figure>
<figure class="hdr-constrained">
<img src="images/hdr-example.jpg" alt="HDR sample photograph">
<figcaption>constrained</figcaption>
</figure>
<figure class="hdr-no-limit">
<img src="images/hdr-example.jpg" alt="HDR sample photograph">
<figcaption>no-limit</figcaption>
</figure>
</div>
CSS Example
.hdr-comparison {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
}
.hdr-comparison figure {
margin: 0;
}
.hdr-comparison img {
display: block;
width: 100%;
height: auto;
}
.hdr-comparison figcaption {
padding: 8px;
background-color: #f1f1f1;
text-align: center;
}
.hdr-comparison .hdr-standard img {
dynamic-range-limit: standard;
}
.hdr-comparison .hdr-constrained img {
dynamic-range-limit: constrained;
}
.hdr-comparison .hdr-no-limit img {
dynamic-range-limit: no-limit;
}
Live Browser Result
The live example below uses a built-in SVG illustration so that the layout remains visible without requiring an external image file. The SVG is not HDR content, so the three panels are expected to look alike. Replace the SVG illustrations with a genuine HDR image to test the property.
The three panels demonstrate where each value is applied. A real HDR image is necessary to demonstrate the luminance differences.
On a supported HDR display, standard limits highlights to reference white, constrained permits some additional brightness, and no-limit allows the available HDR range.
Accessibility
HDR content can produce unusually bright highlights, so luminance management is an important consideration for visual comfort.
Avoid Excessive Brightness
Large or rapidly changing bright areas can be uncomfortable for some visitors. Consider limiting HDR brightness in content-heavy interfaces.
Provide Consistent Viewing Conditions
When SDR and HDR content appear together, constrained or standard may provide a more balanced experience.
Respect User Preferences
When practical, provide a way for visitors to choose whether HDR content uses its full available brightness.
Avoid Flashing Transitions
Do not use rapid HDR brightness changes or flashing highlights as decorative effects.
Maintain Text Contrast
HDR brightness adjustments do not replace proper contrast design. Ensure that text and interface controls remain readable against their backgrounds.
Provide Text Alternatives
HDR images still require appropriate alternative text when they convey information.
Fallback Accessibility
Because support is limited, designs must remain readable and usable when dynamic-range-limit is ignored.
Important Considerations
Keep the following points in mind when using dynamic-range-limit:
- Purpose: Controls the maximum permitted luminance of HDR content.
- Initial value:
no-limit. - Inheritance: The property is inherited.
- Applies to: All elements, although visible effects depend on HDR content and rendering capabilities.
- standard: Limits brightness to HDR reference white.
- constrained: Allows a limited amount of additional HDR brightness.
- no-limit: Permits the available HDR brightness range.
- Custom limits:
dynamic-range-limit-mix()combines predefined values. - Physical brightness: The property does not specify a fixed luminance in nits.
- Hardware: Visible results depend on display capabilities.
- Content: SDR-only content may show no meaningful difference.
- Media queries: The
dynamic-rangefeature can detect HDR-capable output devices. - Animations: Compatible browsers can interpolate between limits.
- Fallbacks: Unsupported browsers ignore the declaration.
- Accessibility: Avoid unnecessary brightness changes and uncomfortable HDR highlights.
- Browser support: The property has limited availability and should be tested before production use.
For mixed HDR and SDR interfaces, constrained is a useful starting point. Use standard when a consistent reference-white limit is preferred, and no-limit when presenting HDR content at its available brightness is intentional.
Browser Support
The CSS dynamic-range-limit property has Limited availability. It is not yet supported consistently across all major browsers and is not classified as a Baseline feature.
Support for the dynamic-range-limit-mix() function and animated transitions may also vary independently of basic keyword support.
Basic Feature Detection
@supports (dynamic-range-limit: constrained) {
.hdr-image {
dynamic-range-limit: constrained;
}
}
Function Feature Detection
.hdr-image {
dynamic-range-limit: constrained;
}
@supports (dynamic-range-limit: dynamic-range-limit-mix(standard 50%, no-limit 50%)) {
.hdr-image {
dynamic-range-limit: dynamic-range-limit-mix(standard 50%, no-limit 50%);
}
}
HDR Display Detection
@media (dynamic-range: high) {
.hdr-image {
dynamic-range-limit: constrained;
}
}
Testing Requirements
Test with genuine HDR media on a compatible display. A browser recognizing the CSS declaration does not guarantee that the current device can display HDR highlights.
For current compatibility information, visit Can I Use? and search for dynamic-range-limit.
Specifications
The dynamic-range-limit property is defined in CSS Color HDR Module Level 1.
CSS Color HDR Module Level 1: dynamic-range-limit
The specification defines the supported keywords, luminance limiting behavior, custom mixing function, inheritance, computed values, and interpolation.
The module is still evolving, so implementations and browser compatibility may change as the specification develops.
