diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector128.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector128.cs
index d4c0398d97..a80dcf86e5 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector128.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector128.cs
@@ -13,31 +13,31 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components;
internal partial struct Block8x8F
{
///
- /// version of and .
+ /// version of .
///
/// The maximum value to normalize to.
[MethodImpl(InliningOptions.ShortMethod)]
- public void NormalizeColorsAndRoundInPlaceVector128(float maximum)
+ public void NormalizeColorsInPlaceVector128(float maximum)
{
Vector128 max = Vector128.Create(maximum);
Vector128 off = Vector128.Ceiling(max * .5F);
- this.V0L = NormalizeAndRoundVector128(this.V0L.AsVector128(), off, max).AsVector4();
- this.V0R = NormalizeAndRoundVector128(this.V0R.AsVector128(), off, max).AsVector4();
- this.V1L = NormalizeAndRoundVector128(this.V1L.AsVector128(), off, max).AsVector4();
- this.V1R = NormalizeAndRoundVector128(this.V1R.AsVector128(), off, max).AsVector4();
- this.V2L = NormalizeAndRoundVector128(this.V2L.AsVector128(), off, max).AsVector4();
- this.V2R = NormalizeAndRoundVector128(this.V2R.AsVector128(), off, max).AsVector4();
- this.V3L = NormalizeAndRoundVector128(this.V3L.AsVector128(), off, max).AsVector4();
- this.V3R = NormalizeAndRoundVector128(this.V3R.AsVector128(), off, max).AsVector4();
- this.V4L = NormalizeAndRoundVector128(this.V4L.AsVector128(), off, max).AsVector4();
- this.V4R = NormalizeAndRoundVector128(this.V4R.AsVector128(), off, max).AsVector4();
- this.V5L = NormalizeAndRoundVector128(this.V5L.AsVector128(), off, max).AsVector4();
- this.V5R = NormalizeAndRoundVector128(this.V5R.AsVector128(), off, max).AsVector4();
- this.V6L = NormalizeAndRoundVector128(this.V6L.AsVector128(), off, max).AsVector4();
- this.V6R = NormalizeAndRoundVector128(this.V6R.AsVector128(), off, max).AsVector4();
- this.V7L = NormalizeAndRoundVector128(this.V7L.AsVector128(), off, max).AsVector4();
- this.V7R = NormalizeAndRoundVector128(this.V7R.AsVector128(), off, max).AsVector4();
+ this.V0L = NormalizeVector128(this.V0L.AsVector128(), off, max).AsVector4();
+ this.V0R = NormalizeVector128(this.V0R.AsVector128(), off, max).AsVector4();
+ this.V1L = NormalizeVector128(this.V1L.AsVector128(), off, max).AsVector4();
+ this.V1R = NormalizeVector128(this.V1R.AsVector128(), off, max).AsVector4();
+ this.V2L = NormalizeVector128(this.V2L.AsVector128(), off, max).AsVector4();
+ this.V2R = NormalizeVector128(this.V2R.AsVector128(), off, max).AsVector4();
+ this.V3L = NormalizeVector128(this.V3L.AsVector128(), off, max).AsVector4();
+ this.V3R = NormalizeVector128(this.V3R.AsVector128(), off, max).AsVector4();
+ this.V4L = NormalizeVector128(this.V4L.AsVector128(), off, max).AsVector4();
+ this.V4R = NormalizeVector128(this.V4R.AsVector128(), off, max).AsVector4();
+ this.V5L = NormalizeVector128(this.V5L.AsVector128(), off, max).AsVector4();
+ this.V5R = NormalizeVector128(this.V5R.AsVector128(), off, max).AsVector4();
+ this.V6L = NormalizeVector128(this.V6L.AsVector128(), off, max).AsVector4();
+ this.V6R = NormalizeVector128(this.V6R.AsVector128(), off, max).AsVector4();
+ this.V7L = NormalizeVector128(this.V7L.AsVector128(), off, max).AsVector4();
+ this.V7R = NormalizeVector128(this.V7R.AsVector128(), off, max).AsVector4();
}
///
@@ -71,8 +71,8 @@ internal partial struct Block8x8F
}
[MethodImpl(InliningOptions.ShortMethod)]
- private static Vector128 NormalizeAndRoundVector128(Vector128 value, Vector128 off, Vector128 max)
- => Vector128_.RoundToNearestInteger(Vector128_.Clamp(value + off, Vector128.Zero, max));
+ private static Vector128 NormalizeVector128(Vector128 value, Vector128 off, Vector128 max)
+ => Vector128_.Clamp(value + off, Vector128.Zero, max);
private static void MultiplyIntoInt16Vector128(ref Block8x8F a, ref Block8x8F b, ref Block8x8 dest)
{
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector256.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector256.cs
index 2aaf5c9431..f16452ed52 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector256.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Vector256.cs
@@ -39,23 +39,23 @@ internal partial struct Block8x8F
#pragma warning restore SA1310 // Field names should not contain underscore
///
- /// version of and .
+ /// version of .
///
/// The maximum value to normalize to.
[MethodImpl(InliningOptions.ShortMethod)]
- public void NormalizeColorsAndRoundInPlaceVector256(float maximum)
+ public void NormalizeColorsInPlaceVector256(float maximum)
{
Vector256 max = Vector256.Create(maximum);
Vector256 off = Vector256.Ceiling(max * .5F);
- this.V256_0 = NormalizeAndRoundVector256(this.V256_0, off, max);
- this.V256_1 = NormalizeAndRoundVector256(this.V256_1, off, max);
- this.V256_2 = NormalizeAndRoundVector256(this.V256_2, off, max);
- this.V256_3 = NormalizeAndRoundVector256(this.V256_3, off, max);
- this.V256_4 = NormalizeAndRoundVector256(this.V256_4, off, max);
- this.V256_5 = NormalizeAndRoundVector256(this.V256_5, off, max);
- this.V256_6 = NormalizeAndRoundVector256(this.V256_6, off, max);
- this.V256_7 = NormalizeAndRoundVector256(this.V256_7, off, max);
+ this.V256_0 = NormalizeVector256(this.V256_0, off, max);
+ this.V256_1 = NormalizeVector256(this.V256_1, off, max);
+ this.V256_2 = NormalizeVector256(this.V256_2, off, max);
+ this.V256_3 = NormalizeVector256(this.V256_3, off, max);
+ this.V256_4 = NormalizeVector256(this.V256_4, off, max);
+ this.V256_5 = NormalizeVector256(this.V256_5, off, max);
+ this.V256_6 = NormalizeVector256(this.V256_6, off, max);
+ this.V256_7 = NormalizeVector256(this.V256_7, off, max);
}
///
@@ -95,10 +95,10 @@ internal partial struct Block8x8F
}
[MethodImpl(InliningOptions.ShortMethod)]
- private static Vector256 NormalizeAndRoundVector256(Vector256 value, Vector256 off, Vector256 max)
- => Vector256_.RoundToNearestInteger(Vector256_.Clamp(value + off, Vector256.Zero, max));
+ private static Vector256 NormalizeVector256(Vector256 value, Vector256 off, Vector256 max)
+ => Vector256_.Clamp(value + off, Vector256.Zero, max);
- private static unsafe void MultiplyIntoInt16Vector256(ref Block8x8F a, ref Block8x8F b, ref Block8x8 dest)
+ private static void MultiplyIntoInt16Vector256(ref Block8x8F a, ref Block8x8F b, ref Block8x8 dest)
{
DebugGuard.IsTrue(Vector256.IsHardwareAccelerated, "Vector256 support is required to run this operation!");
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs
index 49b519201f..19a695d07d 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs
@@ -132,7 +132,7 @@ internal partial struct Block8x8F : IEquatable
///
/// Destination
[MethodImpl(InliningOptions.ShortMethod)]
- public unsafe void ScaledCopyTo(float[] dest)
+ public void ScaledCopyTo(float[] dest)
{
DebugGuard.MustBeGreaterThanOrEqualTo(dest.Length, Size, "dest is too small");
@@ -193,7 +193,7 @@ internal partial struct Block8x8F : IEquatable
///
/// The other block.
[MethodImpl(InliningOptions.ShortMethod)]
- public unsafe void MultiplyInPlace(ref Block8x8F other)
+ public void MultiplyInPlace(ref Block8x8F other)
{
if (Vector256.IsHardwareAccelerated)
{
@@ -324,62 +324,43 @@ internal partial struct Block8x8F : IEquatable
}
///
- /// Level shift by +maximum/2, clip to [0..maximum], and round all the values in the block.
+ /// Level shift by +maximum/2, clip to [0, maximum]
///
- /// The maximum value.
- public void NormalizeColorsAndRoundInPlace(float maximum)
+ /// The maximum value to normalize to.
+ public void NormalizeColorsInPlace(float maximum)
{
if (Vector256.IsHardwareAccelerated)
{
- this.NormalizeColorsAndRoundInPlaceVector256(maximum);
+ this.NormalizeColorsInPlaceVector256(maximum);
+ return;
}
else if (Vector128.IsHardwareAccelerated)
{
- this.NormalizeColorsAndRoundInPlaceVector128(maximum);
+ this.NormalizeColorsInPlaceVector128(maximum);
+ return;
}
else
{
- this.NormalizeColorsInPlace(maximum);
- this.RoundInPlace();
- }
- }
-
- ///
- /// Level shift by +maximum/2, clip to [0, maximum]
- ///
- /// The maximum value to normalize to.
- public void NormalizeColorsInPlace(float maximum)
- {
- Vector4 min = Vector4.Zero;
- Vector4 max = new(maximum);
- Vector4 off = new(MathF.Ceiling(maximum * 0.5F));
-
- this.V0L = Vector4.Clamp(this.V0L + off, min, max);
- this.V0R = Vector4.Clamp(this.V0R + off, min, max);
- this.V1L = Vector4.Clamp(this.V1L + off, min, max);
- this.V1R = Vector4.Clamp(this.V1R + off, min, max);
- this.V2L = Vector4.Clamp(this.V2L + off, min, max);
- this.V2R = Vector4.Clamp(this.V2R + off, min, max);
- this.V3L = Vector4.Clamp(this.V3L + off, min, max);
- this.V3R = Vector4.Clamp(this.V3R + off, min, max);
- this.V4L = Vector4.Clamp(this.V4L + off, min, max);
- this.V4R = Vector4.Clamp(this.V4R + off, min, max);
- this.V5L = Vector4.Clamp(this.V5L + off, min, max);
- this.V5R = Vector4.Clamp(this.V5R + off, min, max);
- this.V6L = Vector4.Clamp(this.V6L + off, min, max);
- this.V6R = Vector4.Clamp(this.V6R + off, min, max);
- this.V7L = Vector4.Clamp(this.V7L + off, min, max);
- this.V7R = Vector4.Clamp(this.V7R + off, min, max);
- }
-
- ///
- /// Rounds all values in the block.
- ///
- public void RoundInPlace()
- {
- for (int i = 0; i < Size; i++)
- {
- this[i] = MathF.Round(this[i]);
+ Vector4 min = Vector4.Zero;
+ Vector4 max = new(maximum);
+ Vector4 off = new(MathF.Ceiling(maximum * 0.5F));
+
+ this.V0L = Vector4.Clamp(this.V0L + off, min, max);
+ this.V0R = Vector4.Clamp(this.V0R + off, min, max);
+ this.V1L = Vector4.Clamp(this.V1L + off, min, max);
+ this.V1R = Vector4.Clamp(this.V1R + off, min, max);
+ this.V2L = Vector4.Clamp(this.V2L + off, min, max);
+ this.V2R = Vector4.Clamp(this.V2R + off, min, max);
+ this.V3L = Vector4.Clamp(this.V3L + off, min, max);
+ this.V3R = Vector4.Clamp(this.V3R + off, min, max);
+ this.V4L = Vector4.Clamp(this.V4L + off, min, max);
+ this.V4R = Vector4.Clamp(this.V4R + off, min, max);
+ this.V5L = Vector4.Clamp(this.V5L + off, min, max);
+ this.V5R = Vector4.Clamp(this.V5R + off, min, max);
+ this.V6L = Vector4.Clamp(this.V6L + off, min, max);
+ this.V6R = Vector4.Clamp(this.V6R + off, min, max);
+ this.V7L = Vector4.Clamp(this.V7L + off, min, max);
+ this.V7R = Vector4.Clamp(this.V7R + off, min, max);
}
}
@@ -533,7 +514,7 @@ internal partial struct Block8x8F : IEquatable
}
///
- public bool Equals(Block8x8F other)
+ public readonly bool Equals(Block8x8F other)
=> this.V0L == other.V0L
&& this.V0R == other.V0R
&& this.V1L == other.V1L
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentProcessors/DirectComponentProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentProcessors/DirectComponentProcessor.cs
index 79e25a67a9..b4399a69cd 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentProcessors/DirectComponentProcessor.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentProcessors/DirectComponentProcessor.cs
@@ -53,10 +53,10 @@ internal sealed class DirectComponentProcessor : ComponentProcessor
// Convert from spectral to color
FloatingPointDCT.TransformIDCT(ref workspaceBlock);
- // To conform better to libjpeg we actually NEED TO loose precision here.
- // This is because they store blocks as Int16 between all the operations.
- // To be "more accurate", we need to emulate this by rounding!
- workspaceBlock.NormalizeColorsAndRoundInPlace(maximumValue);
+ // Normalize into the component sample range without quantizing away
+ // fractional precision. The later color conversion / final pack stage
+ // performs the only rounding we actually need for output samples.
+ workspaceBlock.NormalizeColorsInPlace(maximumValue);
// Write to color buffer acording to sampling factors
int xColorBufferStart = xBlock * this.BlockAreaSize.Width;
diff --git a/src/ImageSharp/Formats/Jpeg/Components/ScaledFloatingPointDCT.cs b/src/ImageSharp/Formats/Jpeg/Components/ScaledFloatingPointDCT.cs
index b8234ff3e4..b4d32f7095 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/ScaledFloatingPointDCT.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/ScaledFloatingPointDCT.cs
@@ -136,10 +136,10 @@ internal static class ScaledFloatingPointDCT
(z4 * FP32_2_562915447);
// Save results to the top left 4x4 subregion
- block[(ctr * 8) + 0] = MathF.Round(Numerics.Clamp(((tmp10 + tmp2) * 0.5F) + normalizationValue, 0, maxValue));
- block[(ctr * 8) + 3] = MathF.Round(Numerics.Clamp(((tmp10 - tmp2) * 0.5F) + normalizationValue, 0, maxValue));
- block[(ctr * 8) + 1] = MathF.Round(Numerics.Clamp(((tmp12 + tmp0) * 0.5F) + normalizationValue, 0, maxValue));
- block[(ctr * 8) + 2] = MathF.Round(Numerics.Clamp(((tmp12 - tmp0) * 0.5F) + normalizationValue, 0, maxValue));
+ block[(ctr * 8) + 0] = Numerics.Clamp(((tmp10 + tmp2) * 0.5F) + normalizationValue, 0, maxValue);
+ block[(ctr * 8) + 3] = Numerics.Clamp(((tmp10 - tmp2) * 0.5F) + normalizationValue, 0, maxValue);
+ block[(ctr * 8) + 1] = Numerics.Clamp(((tmp12 + tmp0) * 0.5F) + normalizationValue, 0, maxValue);
+ block[(ctr * 8) + 2] = Numerics.Clamp(((tmp12 - tmp0) * 0.5F) + normalizationValue, 0, maxValue);
}
}
@@ -199,8 +199,8 @@ internal static class ScaledFloatingPointDCT
(block[ctr + (8 * 1) + 2] * FP32_3_624509785);
// Save results to the top left 2x2 subregion
- block[(ctr * 8) + 0] = MathF.Round(Numerics.Clamp(((tmp10 + tmp0) * 0.25F) + normalizationValue, 0, maxValue));
- block[(ctr * 8) + 1] = MathF.Round(Numerics.Clamp(((tmp10 - tmp0) * 0.25F) + normalizationValue, 0, maxValue));
+ block[(ctr * 8) + 0] = Numerics.Clamp(((tmp10 + tmp0) * 0.25F) + normalizationValue, 0, maxValue);
+ block[(ctr * 8) + 1] = Numerics.Clamp(((tmp10 - tmp0) * 0.25F) + normalizationValue, 0, maxValue);
}
}
@@ -213,6 +213,6 @@ internal static class ScaledFloatingPointDCT
/// Output range normalization value, 1/2 of the .
/// Maximum value of the output range.
public static float TransformIDCT_1x1(float dc, float dequantizer, float normalizationValue, float maxValue)
- => MathF.Round(Numerics.Clamp((dc * dequantizer) + normalizationValue, 0, maxValue));
+ => Numerics.Clamp((dc * dequantizer) + normalizationValue, 0, maxValue);
}
#pragma warning restore IDE0078
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
index 368a7b3692..544ac85a51 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
@@ -181,54 +181,6 @@ public partial class Block8x8FTests : JpegFixture
}
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public void NormalizeColorsAndRoundVector256(int seed)
- {
- if (this.SkipOnNonVector256Runner())
- {
- return;
- }
-
- Block8x8F source = CreateRandomFloatBlock(-200, 200, seed);
-
- Block8x8F expected = source;
- expected.NormalizeColorsInPlace(255);
- expected.RoundInPlace();
-
- Block8x8F actual = source;
- actual.NormalizeColorsAndRoundInPlaceVector256(255);
-
- this.Output.WriteLine(expected.ToString());
- this.Output.WriteLine(actual.ToString());
- this.CompareBlocks(expected, actual, 0);
- }
-
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public void NormalizeColorsAndRoundVector128(int seed)
- {
- if (this.SkipOnNonVector128Runner())
- {
- return;
- }
-
- Block8x8F source = CreateRandomFloatBlock(-200, 200, seed);
-
- Block8x8F expected = source;
- expected.NormalizeColorsInPlace(255);
- expected.RoundInPlace();
-
- Block8x8F actual = source;
- actual.NormalizeColorsAndRoundInPlaceVector128(255);
-
- this.Output.WriteLine(expected.ToString());
- this.Output.WriteLine(actual.ToString());
- this.CompareBlocks(expected, actual, 0);
- }
-
[Theory]
[InlineData(1, 2)]
[InlineData(2, 1)]
@@ -290,29 +242,6 @@ public partial class Block8x8FTests : JpegFixture
}
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- [InlineData(3)]
- public void RoundInPlaceSlow(int seed)
- {
- Block8x8F s = CreateRandomFloatBlock(-500, 500, seed);
-
- Block8x8F d = s;
- d.RoundInPlace();
-
- this.Output.WriteLine(s.ToString());
- this.Output.WriteLine(d.ToString());
-
- for (int i = 0; i < 64; i++)
- {
- float expected = (float)Math.Round(s[i]);
- float actual = d[i];
-
- Assert.Equal(expected, actual);
- }
- }
-
[Fact]
public void MultiplyInPlace_ByOtherBlock()
{
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
index 50eada4c7c..83c3a344da 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
@@ -193,7 +193,7 @@ public static class DCTTests
{
for (int x = 0; x < 4; x++)
{
- AssertScaledElementEquality(expectedSpan.Slice((y * 16) + (x * 2)), actualSpan.Slice((y * 8) + x));
+ AssertScaledElementEquality(expectedSpan[((y * 16) + (x * 2))..], actualSpan[((y * 8) + x)..]);
}
}
@@ -210,7 +210,7 @@ public static class DCTTests
}
}
- average2x2 = MathF.Round(average2x2 / 4f);
+ average2x2 /= 4f;
Assert.Equal((int)average2x2, (int)actual[0]);
}
@@ -254,7 +254,7 @@ public static class DCTTests
{
for (int x = 0; x < 2; x++)
{
- AssertScaledElementEquality(expectedSpan.Slice((y * 32) + (x * 4)), actualSpan.Slice((y * 8) + x));
+ AssertScaledElementEquality(expectedSpan[((y * 32) + (x * 4))..], actualSpan[((y * 8) + x)..]);
}
}
@@ -271,7 +271,7 @@ public static class DCTTests
}
}
- average4x4 = MathF.Round(average4x4 / 16f);
+ average4x4 /= 16f;
Assert.Equal((int)average4x4, (int)actual[0]);
}
@@ -311,7 +311,7 @@ public static class DCTTests
NormalizationValue,
MaxOutputValue);
- float expected = MathF.Round(Numerics.Clamp(expectedDest[0] + NormalizationValue, 0, MaxOutputValue));
+ float expected = Numerics.Clamp(expectedDest[0] + NormalizationValue, 0, MaxOutputValue);
Assert.Equal((int)actual, (int)expected);
}
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs
index f147e41325..e7e6d20334 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs
@@ -30,7 +30,7 @@ public partial class JpegDecoderTests
}
using Image image = provider.GetImage(JpegDecoder.Instance);
- image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr);
+ image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr, appendPixelTypeToFileName: false);
provider.Utility.TestName = DecodeBaselineJpegOutputName;
image.CompareToReferenceOutput(
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs
index a5472e1aef..fff1e085b3 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs
@@ -21,7 +21,7 @@ public partial class JpegDecoderTests
where TPixel : unmanaged, IPixel
{
using Image image = provider.GetImage(JpegDecoder.Instance);
- image.DebugSave(provider);
+ image.DebugSave(provider, appendPixelTypeToFileName: false);
provider.Utility.TestName = DecodeProgressiveJpegOutputName;
image.CompareToReferenceOutput(
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs
index ede147dbe9..5fae85cc85 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs
@@ -49,7 +49,7 @@ public partial class JpegEncoderTests
public static readonly TheoryData CmykEncodingSetups = new()
{
- { JpegColorType.Cmyk, 100, 0.0159f / 100 },
+ { JpegColorType.Cmyk, 100, 0.0164f / 100 },
{ JpegColorType.Cmyk, 80, 0.3922f / 100 },
{ JpegColorType.Cmyk, 40, 0.6488f / 100 },
};
diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
index e432a7251b..6123d46dac 100644
--- a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
@@ -707,17 +707,17 @@ public class TiffDecoderTests : TiffDecoderBaseTester
[WithFile(YCbCrJpegCompressed2, PixelTypes.Rgba32)]
[WithFile(RgbJpegCompressedNoJpegTable, PixelTypes.Rgba32)]
[WithFile(GrayscaleJpegCompressed, PixelTypes.Rgba32)]
- [WithFile(Issues2123, PixelTypes.Rgba32)]
- public void TiffDecoder_CanDecode_JpegCompressed(TestImageProvider provider)
- where TPixel : unmanaged, IPixel => TestTiffDecoder(provider, useExactComparer: false);
+ [WithFile(Issues2123, PixelTypes.Rgba32, 0.110f)]
+ public void TiffDecoder_CanDecode_JpegCompressed(TestImageProvider provider, float tolerance = 0.001f)
+ where TPixel : unmanaged, IPixel => TestTiffDecoder(provider, useExactComparer: false, compareTolerance: tolerance);
[Theory]
[WithFile(RgbOldJpegCompressed, PixelTypes.Rgba32)]
- [WithFile(RgbOldJpegCompressed2, PixelTypes.Rgba32)]
+ [WithFile(RgbOldJpegCompressed2, PixelTypes.Rgba32, 0.1003f)]
[WithFile(RgbOldJpegCompressed3, PixelTypes.Rgba32)]
[WithFile(RgbOldJpegCompressedGray, PixelTypes.Rgba32)]
[WithFile(YCbCrOldJpegCompressed, PixelTypes.Rgba32)]
- public void TiffDecoder_CanDecode_OldJpegCompressed(TestImageProvider provider)
+ public void TiffDecoder_CanDecode_OldJpegCompressed(TestImageProvider provider, float tolerance = 0.001f)
where TPixel : unmanaged, IPixel
{
DecoderOptions decoderOptions = new()
@@ -728,7 +728,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester
image.DebugSave(provider);
image.CompareToOriginal(
provider,
- ImageComparer.Tolerant(0.001f),
+ ImageComparer.Tolerant(tolerance),
ReferenceDecoder,
decoderOptions);
}
@@ -784,7 +784,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester
// The image is handcrafted to simulate issue 2679. ImageMagick will throw an expection here and wont decode,
// so we compare to rererence output instead.
- image.DebugSave(provider);
+ image.DebugSave(provider, appendPixelTypeToFileName: false);
image.CompareToReferenceOutput(
ImageComparer.Exact,
provider,
diff --git a/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SeparateChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png b/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SeparateChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
index de79ec729c..84c7e64ee0 100644
--- a/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SeparateChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
+++ b/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SeparateChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:aada4a2ccf45de24f2a591a18d9bc0260ceb3829e104fee6982061013ed87282
-size 14107709
+oid sha256:4a4d2a3a1f320d3fcb121bd8edf716354b7e8ceb251a9eaa2087f443a3adbbc1
+size 10896218
diff --git a/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SynchronizedChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png b/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SynchronizedChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
index ff5b35a5f7..679615d17e 100644
--- a/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SynchronizedChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
+++ b/tests/Images/External/ReferenceOutput/HistogramEqualizationTests/AutoLevel_SynchronizedChannels_CompareToReferenceOutput_Rgba32_forest_bridge.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:dca9b5b890d3a79b0002b7093d254d484ada4207e5010d1f0c6248d4dd6e22db
-size 13909894
+oid sha256:0c3f30908a803ac5956dbd5959b225bceab1fc673a1b89d55d1096ba024c7bcc
+size 12519351
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Calliphora.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Calliphora.png
index 07c29c0976..95ea3d4721 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Calliphora.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Calliphora.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:362eddc5e06d672b4654bfe7a1ded995934a1c59719a3f909773b2e61931ffac
-size 1332495
+oid sha256:9a6f484f06c0b466d16591db78fec3cd2c3f6ebc7578896075cd4af95d8ceaab
+size 1411818
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Issue394-MultiHuffmanBaseline-Speakers.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Issue394-MultiHuffmanBaseline-Speakers.png
index 1f38ec542f..8288801623 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Issue394-MultiHuffmanBaseline-Speakers.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_Issue394-MultiHuffmanBaseline-Speakers.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b7a1e89adcd70f792d678786a177bac927a15d6065001cd76aab0bf3cc1b7b4c
-size 1034853
+oid sha256:88271ffea79e42914b8c37828da65afb691c7319b8e28fdd35942ecba4087baa
+size 1060013
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_MultiScanBaselineCMYK.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_MultiScanBaselineCMYK.png
index 349ff64858..e72b1a0415 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_MultiScanBaselineCMYK.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_MultiScanBaselineCMYK.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d9dbb00a4be909d4b7fd605f83f786ff85545da54272a256c100afd80d687e8f
-size 93253
+oid sha256:3b160cc44490303c23c0abaa0dda827d68e11bfa67127e19da974073085abbe4
+size 96042
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badeof.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badeof.png
index 830a95bd74..ccdb19e4db 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badeof.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badeof.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:24f637742951c438da5acbae6a93545830ea4d0065031572a3bdd1c96be15cce
-size 48990
+oid sha256:7ce1a5d71cefd6527daecb8c1d9089f63189b833f1186971ddb89c6257d076ef
+size 46745
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badrst.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badrst.png
index 0512251ab4..4f2aae2ed6 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badrst.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_badrst.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0501e53f97ddb4252e15073dc75f4129428befe5594a07297c21ae9f89f075b2
-size 316278
+oid sha256:522b0a2f9a97689217af461ab2a63a41553c0ae6ca28cde046b01019c87e2393
+size 348228
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_cmyk.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_cmyk.png
index 27c22ecc6d..e24cc59690 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_cmyk.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_cmyk.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d2253c83151238056caef2f3bca8800108a84360b2ff21979e4ff37fdddd2232
-size 419852
+oid sha256:5e81ac851f979c017082180a13ee4ddfe26c4151bfc082f7915252e57da44ec7
+size 416967
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg420small.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg420small.png
index 4032a32afb..ae30676b36 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg420small.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg420small.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2b5e1d91fb6dc1ddb696fbee63331ba9c6ef3548b619c005887e60c5b01f4981
-size 27303
+oid sha256:79291e1eddee66548156fc40bb5c8b1209c7b0048fb56f2bb7890c7d89ce655e
+size 27264
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg422.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg422.png
index 018ecda7a5..8ddb748802 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg422.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg422.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:733cc46271c4402974db2536a55e6ecae3110856df73031ca48dad03745d852d
-size 35375
+oid sha256:5196d5a20f639d833cf1ad979a290c144c97b41897fa5f0fa7454f5f4e8d3c11
+size 28697
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg444.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg444.png
index e5ce7eb3d3..acca4b44e3 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg444.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_jpeg444.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6543f546fac9d05ebdac7a534b0cc422f31bfd81067212a19cb3a52ad24560a8
-size 3978
+oid sha256:9894983085f3d3d45b8c4ea9acc680932f236a4602230046386130aa2af916f1
+size 4936
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig.png
index 830a95bd74..ccdb19e4db 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:24f637742951c438da5acbae6a93545830ea4d0065031572a3bdd1c96be15cce
-size 48990
+oid sha256:7ce1a5d71cefd6527daecb8c1d9089f63189b833f1186971ddb89c6257d076ef
+size 46745
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig12.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig12.png
index 23f1941dcc..dc41461e01 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig12.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_testorig12.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ad57cf87eade9ee6663f575b358eafaa869a16b3b02d0fb00ca8c683422b85a0
-size 47601
+oid sha256:26ef4244aa761c7b6c51534e414f79438753b9dbd1fbf45d2f1e2fd2dd4ec4c1
+size 46636
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck-subsample-1222.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck-subsample-1222.png
index f35c40ed89..66337b5c94 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck-subsample-1222.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck-subsample-1222.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a17478333c6ef0943aeb96faba1c0ea560995d0612564fe033b72b2949f4869f
-size 66748
+oid sha256:91a522b32485af3be304c2d98a60b9906112637a4627d69a072976474cef7485
+size 66932
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck.png
index 5f41fb5239..76183356bd 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeBaselineJpeg_ycck.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:63f7105e9e2d0794b3f7225af2187a5717c12b806b68b33b98e08e0a0b1ffa79
-size 71051
+oid sha256:f374012655af194ebece2e9329da416be830d1cadd24a2bd584480d45751ea78
+size 58272
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_BadEofProgressive.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_BadEofProgressive.png
index 2386ae49a2..ecf22f93ca 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_BadEofProgressive.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_BadEofProgressive.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6e5d84fa88ac8b552c21c042f155801924240d764da365440d28eb8133950925
-size 568177
+oid sha256:36b557cd6d55389b8f02b811ecd2b14f1f1c440c7e8dd5a5a3c55cea57547203
+size 564682
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_ExifUndefType.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_ExifUndefType.png
index 3de8b15578..c144554ca2 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_ExifUndefType.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_ExifUndefType.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:fb636a9f304cdef713b823adc7424108b4d44fada294c48a366278c9b9e7b4b5
-size 20163
+oid sha256:ff9554b1f421ca04e0580fbb505895f002b80298feb128a15cdc045a1625a490
+size 20111
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_fb.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_fb.png
index 07a7c3573e..30bfb538f1 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_fb.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_fb.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2935d3dc66eec334eec65c1ed9fbb04046404a9c28bed413ac635878e63ea6cf
-size 114688
+oid sha256:c2eb2bd4db9b67466d96fe154cd771d6780a24a798a0c051f307425f1b0e3d15
+size 115708
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_progress.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_progress.png
index 8241c36ac3..e9a2a0bd86 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_progress.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/DecodeProgressiveJpeg_progress.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7b48730a7a149e13dd87a24e62c0704895b08a5ed1f8ea48a6a6a7248450750d
-size 301416
+oid sha256:c5c5b5711041f22e8ee1afb344137c00ee80ba51e777689513e8dfeea855befa
+size 297941
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_CMYK_ICC_Jpeg_Rgba32_issue-129.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_CMYK_ICC_Jpeg_Rgba32_issue-129.png
index 77a9d0d9cb..4e554a34d3 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_CMYK_ICC_Jpeg_Rgba32_issue-129.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_CMYK_ICC_Jpeg_Rgba32_issue-129.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:215cba73dfb0e19f75f6dc0c3fefca474bd65f57684a207a11d896e1637bb643
-size 1240827
+oid sha256:9750b54f5220020e0c3f5ce22e4f108cb70290750c613c29beeb49473d5c80a6
+size 1349665
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AdobeRGB-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AdobeRGB-yes.png
index 0963e90b74..37e1e37cdc 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AdobeRGB-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AdobeRGB-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c942b534baa51b8e46e88bd38d1ced319bccf1b55a5711ae5761697b7437fe4e
-size 458321
+oid sha256:dcc32a36dcdfe3b9cfae17a81d3eb180248db4507ae93fdd4bb92e1e5e29950d
+size 466215
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AppleRGB-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AppleRGB-yes.png
index 1e5eaca4da..dbfa40378d 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AppleRGB-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-AppleRGB-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:163711226bdfa2f102b314435baea9f69ad1be1b11ef5ad8348358cd09a029ae
-size 482963
+oid sha256:ae9a32eba21fa0bd2039803b5af8ffdba0409c104746455d5028741f214eb1a1
+size 479922
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ColorMatch-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ColorMatch-yes.png
index 06bee00d7a..5427b5c954 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ColorMatch-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ColorMatch-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6f7981f40bab5bffff3e7c9ea1676d224c173fabbaa6e7a920d7a9dabd58655f
-size 464917
+oid sha256:e2bf66bb6d7eb3ff402b8564fb51bc951792ad47dc17fc9c7c886744638a59bb
+size 469096
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ProPhoto-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ProPhoto-yes.png
index 3ae12c657a..7870440681 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ProPhoto-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-ProPhoto-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:11b02b982c024e295915e88f56a428ad73068217a7ae625f705127ab8c35a4bf
-size 477061
+oid sha256:e9c015e599b1710fd50c4ad61104fb03f27f211c13686cb162baba492ec4a935
+size 482675
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-WideRGB-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-WideRGB-yes.png
index 0a2eb91cc5..2ee122b8de 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-WideRGB-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-WideRGB-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a49967c20cccf824df4de3f105f5ddb44d7a602c072ce22caa38939f21f62505
-size 469827
+oid sha256:e25ba3afb3346633db52e91062c4266474bc9d9c0b3fcf686f1040b3a4d70d0d
+size 476050
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-sRGB-yes.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-sRGB-yes.png
index fa554484bb..a1e876d2b2 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-sRGB-yes.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Momiji-sRGB-yes.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4b33fc8fd03142aaaf8aabc39e084acd9e82e9222292e281953d92d65edcc1a7
-size 436111
+oid sha256:b80e88a7fdb27491687202c247eafbeb9d1c024affd5dc4633bcf15602fed990
+size 464921
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual-cLUT-only.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual-cLUT-only.png
index a0b73d299f..8a27087f51 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual-cLUT-only.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual-cLUT-only.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:fe06798b92c9b476c167407e752b4379d50f1b1ad6329eceb368c8c36097b401
-size 95103
+oid sha256:dbe96e449dfeadc71bbfb0b48d2f56e6357d5b64a225153eed60263ea3356e71
+size 119987
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual.png
index 99ae53f93e..586bc96479 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_Perceptual.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:21f8d54d4b789b783f3020402d4c1b91bb541de6565e2960976b569f60694631
-size 99385
+oid sha256:6e9e4da17b7270565fd592f4ff710ff317e1054794d966d33f11748defc7c35b
+size 124944
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_sRGB_Gray.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_sRGB_Gray.png
index 759b26a60c..5164defc14 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_sRGB_Gray.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_RGB_ICC_Jpeg_Rgba32_sRGB_Gray.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:18ad361f79b4ab26d452d5cc7ada4c121dfbf45d20da7c23a58f71a9497d17a2
-size 5341
+oid sha256:0eaf217570e283b6fb9a7d52ba5087d760d9a98827e507cbae299915871e1c31
+size 2595
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png
index bf95566838..a73e5f31ef 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:cef85199e8560d6669766c094d078831024e44ac7fc537f8696f802c8e06138b
-size 420141
+oid sha256:de73fa7a2cdd79763e40c51381f9a0cf5c7d43db2dcd7a86dad0a5b68377665f
+size 421249
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Bicubic_Calliphora_150_150.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Bicubic_Calliphora_150_150.png
index e982d9034d..16df99e04e 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Bicubic_Calliphora_150_150.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Bicubic_Calliphora_150_150.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1bb6ed717a2af582d60ccd6c1c9c1ac92df0f8662755530b7e9063724835b23b
-size 27709
+oid sha256:9be82bf220095b5650c7cd0a0eba9ee2b0fbe39881ff2bbde465ca9d2f94490f
+size 27803
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Calliphora_150_150.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Calliphora_150_150.png
index 65aac22e90..98aac2c55d 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Calliphora_150_150.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Resize_Calliphora_150_150.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a4804948a2ba604e383dd2dcc4ca4cac91c75ac97a0ab10bd884478429fa50a5
-size 28178
+oid sha256:b7e4b589fdbad2688895317fc760a834624f76cc9a027a65ce3cd6b35563ec85
+size 28514
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Combined_Resize_Calliphora_150_150.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Combined_Resize_Calliphora_150_150.png
index 65aac22e90..98aac2c55d 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Combined_Resize_Calliphora_150_150.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Combined_Resize_Calliphora_150_150.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a4804948a2ba604e383dd2dcc4ca4cac91c75ac97a0ab10bd884478429fa50a5
-size 28178
+oid sha256:b7e4b589fdbad2688895317fc760a834624f76cc9a027a65ce3cd6b35563ec85
+size 28514
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_IDCT_Resize_Calliphora_150_150.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_IDCT_Resize_Calliphora_150_150.png
index abe31b2be7..6659673306 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_IDCT_Resize_Calliphora_150_150.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_IDCT_Resize_Calliphora_150_150.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:fc67170d70378ad8b8c0e1c1695b5c268341f0d26a6c788d1a8dffa8c90482a0
-size 102165
+oid sha256:d28335f6ad2421b6bc7e420c2e61ead73cd64f63ba7e1c9bd98ac1c140188ddb
+size 104381
diff --git a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Scale_Resize_Calliphora_150_150.png b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Scale_Resize_Calliphora_150_150.png
index 87087adc51..9c01562f16 100644
--- a/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Scale_Resize_Calliphora_150_150.png
+++ b/tests/Images/External/ReferenceOutput/JpegDecoderTests/JpegDecoder_Decode_Specialized_Scale_Resize_Calliphora_150_150.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ae7f6ebfd9f2ddd85611827fda13eaf316d36d5187900458568f80b929effb9b
-size 28291
+oid sha256:d0db0474f28d6302aae207b09f63e2de9e9ce6a9777a95dbac69ccb957d08daa
+size 28381
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_Cmyk_Rgba32_Cmyk-jpeg.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_Cmyk_Rgba32_Cmyk-jpeg.png
index 06d60e0303..6f35ecb553 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_Cmyk_Rgba32_Cmyk-jpeg.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_Cmyk_Rgba32_Cmyk-jpeg.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7f68db78d765a7f36570cd7b57a1f06cfca24c3b4916d0692a4aa051209ec327
-size 616
+oid sha256:b1ff0ce13bf0521b8a6f0d77806473c837c45428391786f751186a53fd951c0c
+size 394
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_JpegCompressedWithIssue2679_Issue2679.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_JpegCompressedWithIssue2679_Issue2679.png
index 6150aacb37..d2f11dc175 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_JpegCompressedWithIssue2679_Issue2679.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_JpegCompressedWithIssue2679_Issue2679.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6cd36c7e07a08e22cceecd28a056c80e5553a8c092bfc091e902d13bd5c46f4d
-size 120054
+oid sha256:96729898fee87fc4305913c111a5841af205564d032b916aeb04425a20c6b22c
+size 46540
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_A.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_A.png
index 97118c15b0..addaa27bfe 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_A.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_A.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c4f77673028643af0ac02a8f6a1e2db14052177e3401c369391a8ff7e943770c
-size 7679254
+oid sha256:13f51f69b061303d06b73fa7e626d7252a9fd14aa84c961ea894f6e7cd7218cc
+size 7603818
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_B.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_B.png
index 52accc22dc..445cad99c8 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_B.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_ICC_Rgba32_Issue2454_B.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e616895c21fd8b19a216e8a3ef4968bd413589b5875efdac29860f019a710527
-size 7517284
+oid sha256:b6a35853e44d06a6f74e3aaf558e6a4b9c3209c6c3fa2c8f3ee650bf049ac0d3
+size 7624359
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_A.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_A.png
index 350d1af68c..e88a98fa48 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_A.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_A.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d7911e059049c427229136479740fd62e2e09907549ec3e1421a6a60da6167cc
-size 7840892
+oid sha256:9e91f6ae534b95a9e052158043e929e1da22e0851b4d6dfdb8b802605396758f
+size 7888373
diff --git a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_B.png b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_B.png
index 3dc99e604e..29134afcaa 100644
--- a/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_B.png
+++ b/tests/Images/External/ReferenceOutput/TiffDecoderTests/TiffDecoder_CanDecode_YccK_Rgba32_Issue2454_B.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:291f2033a7b4cfc10fb3301283c167b3fbc288bc173c95b21bc726bf076865af
-size 7649213
+oid sha256:81bb1f05a6f72aebee41941b2390ca0a35c4368758af2d27b3e81bbee8901c56
+size 7956102
diff --git a/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.25.png b/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.25.png
index 331b8b30a6..1a052e4449 100644
--- a/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.25.png
+++ b/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.25.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a68aa183691be3240e881057cb2f5785e50228c9c5dd98163ba766b5cafa8b55
-size 88601
+oid sha256:1f312445263030ea79e2d1a05c62d19ade816c9cda9f0d3494ab76fde1e03ace
+size 92534
diff --git a/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.75.png b/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.75.png
index c375fff78b..769e172b7d 100644
--- a/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.75.png
+++ b/tests/Images/External/ReferenceOutput/Transforms/EntropyCropTest/EntropyCrop_MultiScanBaselineCMYK_0.75.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:53a7bc1aa7279cce0b73568b6ed9b141377f7654b73dcf926c43c22dd908039a
-size 88502
+oid sha256:672f167d514f01c625145701ea0d45ced503a6e84cae75fbdb67e6b0db179aee
+size 92318