Expand description
Viewing condition modeling for perceptual quality assessment.
This module provides the ViewingCondition type which models how an image
will be viewed, affecting perceptual quality thresholds.
§Key Concepts
- acuity_ppd: The viewer’s visual acuity in pixels per degree. This is determined by the display’s pixel density and viewing distance.
- browser_dppx: The browser/OS device pixel ratio (e.g., 2.0 for retina).
- image_intrinsic_dppx: The image’s intrinsic pixels per CSS pixel (for srcset).
- ppd: The effective pixels per degree for this specific image viewing.
§Simulation Modes
When simulating viewing conditions for metric calculation, there are two approaches:
-
SimulationMode::Accurate: Simulate browser behavior exactly, including upscaling undersized images. This matches real-world viewing but introduces resampling artifacts. -
SimulationMode::DownsampleOnly: Never upsample images. For undersized images, adjust the effective PPD instead. This avoids simulation artifacts but requires metric threshold adjustment.
Modules§
- presets
- Pre-defined viewing condition presets for common scenarios.
Structs§
- Simulation
Params - Parameters for viewing simulation.
- Viewing
Condition - Viewing condition for perceptual quality assessment.
Enums§
- Simulation
Mode - How to handle image scaling during viewing simulation.
Constants§
- REFERENCE_
PPD - Reference PPD for metric threshold normalization.