From 14ced6f6d2594cba4a54711b134301c96407e841 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Tue, 12 Mar 2024 12:02:45 +0100 Subject: [PATCH] Set YcbcrSubSampling to 1, 1 with jpeg compression and PhotometricInterpretation YCbCr --- .../Formats/Tiff/TiffDecoderOptionsParser.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs b/src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs index 5a5c2b3e51..7172bd6fe6 100644 --- a/src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs +++ b/src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs @@ -628,6 +628,12 @@ internal static class TiffDecoderOptionsParser options.ColorType = TiffColorType.Rgb; } + if (options.PhotometricInterpretation is TiffPhotometricInterpretation.YCbCr) + { + options.YcbcrSubSampling[0] = 1; + options.YcbcrSubSampling[1] = 1; + } + break; } @@ -642,6 +648,12 @@ internal static class TiffDecoderOptionsParser options.ColorType = TiffColorType.Rgb; } + if (options.PhotometricInterpretation is TiffPhotometricInterpretation.YCbCr) + { + options.YcbcrSubSampling[0] = 1; + options.YcbcrSubSampling[1] = 1; + } + break; }