From d537ede70a43988a7b243f8077e771aece5f7f2f Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Mon, 19 Jul 2021 19:53:04 +0300 Subject: [PATCH] Updated thresholds --- src/ImageSharp/Formats/Jpeg/Components/Quantization.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Quantization.cs b/src/ImageSharp/Formats/Jpeg/Components/Quantization.cs index 3087551d01..dc1801f6d0 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Quantization.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Quantization.cs @@ -37,8 +37,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components /// /// Jpeg does not define either 'quality' nor 'standard quantization table' properties /// so this is purely a practical value derived from tests. + /// For actual variances output against standard table see tests at Formats.Jpg.QuantizationTests.PrintVariancesFromStandardTables_*. + /// Actual value is 2.3629059983706604, truncated unsignificant part. /// - public const double StandardLuminanceTableVarianceThreshold = 10.0; + public const double StandardLuminanceTableVarianceThreshold = 2.36291; /// /// Threshold at which given chrominance quantization table should be considered 'standard'. @@ -47,8 +49,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components /// /// Jpeg does not define either 'quality' nor 'standard quantization table' properties /// so this is purely a practical value derived from tests. + /// For actual variances output against standard table see tests at Formats.Jpg.QuantizationTests.PrintVariancesFromStandardTables_*. + /// Actual value is 0.8949631033036098, truncated unsignificant part. /// - public const double StandardChrominanceTableVarianceThreshold = 10.0; + public const double StandardChrominanceTableVarianceThreshold = 0.894963; /// /// Gets the unscaled luminance quantization table in zig-zag order. Each