From 6bf1422548bad354e1b54a677e0a09b45102987a Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 14 Sep 2022 14:40:40 +0200 Subject: [PATCH] jxlsave: sync quality to distance calculation with libjxl (#3050) Ensures the quality to distance conversion is continuous at 30. See: https://github.com/libjxl/libjxl/commit/ea5fa8074d0146ec0f4388f52990d428ea3b67c3 --- libvips/foreign/jxlsave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvips/foreign/jxlsave.c b/libvips/foreign/jxlsave.c index 9c49b95d..f374abee 100644 --- a/libvips/foreign/jxlsave.c +++ b/libvips/foreign/jxlsave.c @@ -249,7 +249,7 @@ vips_foreign_save_jxl_build( VipsObject *object ) if( !vips_object_argument_isset( object, "distance" ) ) jxl->distance = jxl->Q >= 30 ? 0.1 + (100 - jxl->Q) * 0.09 : - 6.4 + pow(2.5, (30 - jxl->Q) / 5.0f) / 6.25f; + 6.24 + pow(2.5, (30 - jxl->Q) / 5.0f) / 6.25f; /* Distance 0 is lossless. libjxl will fail for lossy distance 0. */