-
-
Notifications
You must be signed in to change notification settings - Fork 888
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Description
Saving certain Jpeg images without defining the JpegEnconder quality defaults to a quality below 5.
There's a few jpeg I've seem with this behavior, can't pin point an common trait. Examples further below.
Steps to Reproduce
using (var img = Image.Load("original.jpg"))
{
using (FileStream outImage = File.Create("result.jpg"))
{
img.SaveAsJpeg(outImage);
}
}
Results:
With Quality at 50:
using (var img = Image.Load("original.jpg"))
{
using (FileStream outImage = File.Create("result.jpg"))
{
img.SaveAsJpeg(outImage, new JpegEncoder { Quality = 50 } );
}
}
Results:
As you can see quality 50 produces a higher quality image.
Here are 3 examples images:
quality-loss-example.zip
I've managed to track it down to SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.QualityEvaluator#EstimateQuality method.
'Normal' jpeg this method returns a 75 default quality. My example images the method returns 3 or 2.

System Configuration
- ImageSharp version: 1.0.0-beta0006
- Environment (Operating system, version and so on): Windows 10 pro -Windows Server 2016
- .NET Framework version: .Net Core 2.1
antonfirsov, synercoder, markbrinkman, ErikVenema and deWChris

