Skip to content

Commit 77b18a3

Browse files
authored
Merge pull request SixLabors#909 from brianpopow/feature/dontUseQuantizeOnGray8
Not using quantization for Grey8 images when encoding 8Bit Bitmaps
2 parents 65f0d02 + f521450 commit 77b18a3

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

tests/ImageSharp.Tests/Drawing/DrawImageTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class DrawImageTests
3232
};
3333

3434
[Theory]
35-
[WithFile( TestImages.Png.Rainbow,nameof(BlendingModes), PixelTypes.Rgba32)]
35+
[WithFile(TestImages.Png.Rainbow, nameof(BlendingModes), PixelTypes.Rgba32)]
3636
public void ImageBlendingMatchesSvgSpecExamples<TPixel>(TestImageProvider<TPixel> provider, PixelColorBlendingMode mode)
3737
where TPixel : struct, IPixel<TPixel>
3838
{
@@ -54,13 +54,13 @@ public void ImageBlendingMatchesSvgSpecExamples<TPixel>(TestImageProvider<TPixel
5454
appendSourceFileOrDescription: false);
5555
}
5656
}
57-
57+
5858
[Theory]
5959
[WithFile(TestImages.Png.CalliphoraPartial, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Normal, 1f)]
6060
[WithFile(TestImages.Png.CalliphoraPartial, PixelTypes.Bgr24, TestImages.Png.Bike, PixelColorBlendingMode.Normal, 1f)]
6161
[WithFile(TestImages.Png.CalliphoraPartial, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Normal, 0.75f)]
6262
[WithFile(TestImages.Png.CalliphoraPartial, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Normal, 0.25f)]
63-
63+
6464
[WithTestPatternImages(400, 400, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Multiply, 0.5f)]
6565
[WithTestPatternImages(400, 400, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Add, 0.5f)]
6666
[WithTestPatternImages(400, 400, PixelTypes.Rgba32, TestImages.Png.Splash, PixelColorBlendingMode.Subtract, 0.5f)]
@@ -77,7 +77,7 @@ public void WorksWithDifferentConfigurations<TPixel>(
7777
using (Image<TPixel> image = provider.GetImage())
7878
using (var blend = Image.Load<TPixel>(TestFile.Create(brushImage).Bytes))
7979
{
80-
Size size = new Size(image.Width * 3 / 4, image.Height *3/ 4);
80+
Size size = new Size(image.Width * 3 / 4, image.Height * 3 / 4);
8181
Point position = new Point(image.Width / 8, image.Height / 8);
8282
blend.Mutate(x => x.Resize(size.Width, size.Height, KnownResamplers.Bicubic));
8383
image.Mutate(x => x.DrawImage(blend, position, mode, opacity));
@@ -89,7 +89,7 @@ public void WorksWithDifferentConfigurations<TPixel>(
8989
{
9090
encoder.BitDepth = PngBitDepth.Bit16;
9191
}
92-
92+
9393
image.DebugSave(provider, testInfo, encoder: encoder);
9494
image.CompareToReferenceOutput(ImageComparer.TolerantPercentage(0.01f),
9595
provider,
@@ -138,15 +138,15 @@ public void WorksWithDifferentLocations(TestImageProvider<Rgba32> provider, int
138138
testOutputDetails: $"{x}_{y}",
139139
appendPixelTypeToFileName: false,
140140
appendSourceFileOrDescription: false);
141-
141+
142142
background.CompareToReferenceOutput(
143143
provider,
144144
testOutputDetails: $"{x}_{y}",
145145
appendPixelTypeToFileName: false,
146146
appendSourceFileOrDescription: false);
147147
}
148148
}
149-
149+
150150
[Theory]
151151
[WithFile(TestImages.Png.Splash, PixelTypes.Rgba32)]
152152
public void DrawTransformed<TPixel>(TestImageProvider<TPixel> provider)
@@ -166,12 +166,12 @@ public void DrawTransformed<TPixel>(TestImageProvider<TPixel> provider)
166166

167167
// Lets center the matrix so we can tell whether any cut-off issues we may have belong to the drawing processor
168168
var position = new Point((image.Width - blend.Width) / 2, (image.Height - blend.Height) / 2);
169-
image.Mutate(x => x.DrawImage(blend, position, .75F));
170-
169+
image.Mutate(x => x.DrawImage(blend, position, .75F));
170+
171171
image.DebugSave(provider, appendSourceFileOrDescription: false, appendPixelTypeToFileName: false);
172172
image.CompareToReferenceOutput(ImageComparer.TolerantPercentage(0.002f),
173173
provider,
174-
appendSourceFileOrDescription: false,
174+
appendSourceFileOrDescription: false,
175175
appendPixelTypeToFileName: false);
176176
}
177177
}
@@ -197,6 +197,6 @@ void Test()
197197
}
198198
}
199199

200-
200+
201201
}
202202
}

0 commit comments

Comments
 (0)