pub unsafe extern "C-unwind" fn JxlEncoderDistanceFromQuality(
quality: f32,
) -> f32Expand description
Maps JPEG-style quality factor to distance.
This function takes in input a JPEG-style quality factor quality and
produces as output a distance value suitable to be used with
JxlEncoderSetFrameDistance and JxlEncoderSetExtraChannelDistance.
The distance value influences the level of compression, with lower values
indicating higher quality:
- 0.0 implies lossless compression (however, note that calling
JxlEncoderSetFrameLosslessis required). - 1.0 represents a visually lossy compression, which is also the default setting.
The quality parameter, ranging up to 100, is inversely related to
distance:
- A
qualityof 100.0 maps to adistanceof 0.0 (lossless). - A
qualityof 90.0 corresponds to adistanceof 1.0.
Recommended Range:
distance: 0.5 to 3.0.- corresponding
quality: approximately 96 to 68.
Allowed Range:
distance: 0.0 to 25.0.- corresponding
quality: 100.0 to 0.0.
Note: the quality parameter has no consistent psychovisual meaning
across different codecs and libraries. Using the mapping defined by
JxlEncoderDistanceFromQuality will result in a visual quality roughly
equivalent to what would be obtained with libjpeg-turbo with the same
quality parameter, but that is by no means guaranteed; do not assume that
the same quality value will result in similar file sizes and image quality
across different codecs.