diff --git a/src/ImageSharp.Processing/Processors/Binarization/OrderedDitherProcessor.cs b/src/ImageSharp.Processing/Processors/Binarization/OrderedDitherProcessor.cs index b2a1e9a228..ae1224bad0 100644 --- a/src/ImageSharp.Processing/Processors/Binarization/OrderedDitherProcessor.cs +++ b/src/ImageSharp.Processing/Processors/Binarization/OrderedDitherProcessor.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // @@ -18,7 +18,7 @@ namespace ImageSharp.Processing.Processors where TColor : struct, IPackedPixel, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The ordered ditherer. /// The component index to test the threshold against. Must range from 0 to 3. diff --git a/src/ImageSharp/Dithering/Ordered/Bayer.cs b/src/ImageSharp/Dithering/Ordered/Bayer.cs index 52e91946ba..3674be0aaf 100644 --- a/src/ImageSharp/Dithering/Ordered/Bayer.cs +++ b/src/ImageSharp/Dithering/Ordered/Bayer.cs @@ -17,11 +17,12 @@ namespace ImageSharp.Dithering.Ordered /// The threshold matrix. /// This is calculated by multiplying each value in the original matrix by 16 and subtracting 1 /// - private static readonly byte[,] ThresholdMatrix = { - { 15, 143, 47, 175 }, - { 207, 79, 239, 111 }, - { 63, 191, 31, 159 }, - { 255, 127, 223, 95 } + private static readonly byte[,] ThresholdMatrix = + { + { 15, 143, 47, 175 }, + { 207, 79, 239, 111 }, + { 63, 191, 31, 159 }, + { 255, 127, 223, 95 } }; /// diff --git a/src/ImageSharp/Dithering/Ordered/Ordered.cs b/src/ImageSharp/Dithering/Ordered/Ordered.cs index 7c8a15386c..2e7766e0bd 100644 --- a/src/ImageSharp/Dithering/Ordered/Ordered.cs +++ b/src/ImageSharp/Dithering/Ordered/Ordered.cs @@ -17,11 +17,12 @@ namespace ImageSharp.Dithering.Ordered /// The threshold matrix. /// This is calculated by multiplying each value in the original matrix by 16 /// - private static readonly byte[,] ThresholdMatrix = { - { 0, 128, 32, 160 }, - { 192, 64, 224, 96 }, - { 48, 176, 16, 144 }, - { 240, 112, 208, 80 } + private static readonly byte[,] ThresholdMatrix = + { + { 0, 128, 32, 160 }, + { 192, 64, 224, 96 }, + { 48, 176, 16, 144 }, + { 240, 112, 208, 80 } }; /// diff --git a/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs b/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs index 2cd2de4f59..c0aab00ed6 100644 --- a/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs +++ b/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs @@ -437,7 +437,7 @@ namespace ImageSharp.Quantizers { if (this.leaf) { - // TODO: Test Vector4 here + // This seems faster than using Vector4 byte r = (this.red / this.pixelCount).ToByte(); byte g = (this.green / this.pixelCount).ToByte(); byte b = (this.blue / this.pixelCount).ToByte(); diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index a03833b25c..8a26fb4bad 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -57,8 +57,6 @@ namespace ImageSharp where TColor : struct, IPackedPixel, IEquatable { QuantizedImage quantized = quantizer.Quantize(source, maxColors); - - int pixelCount = quantized.Pixels.Length; int palleteCount = quantized.Palette.Length - 1; using (PixelAccessor pixels = new PixelAccessor(quantized.Width, quantized.Height)) @@ -69,9 +67,9 @@ namespace ImageSharp source.Configuration.ParallelOptions, y => { - for (var x = 0; x < pixels.Width; x++) + for (int x = 0; x < pixels.Width; x++) { - var i = x + (y * pixels.Width); + int i = x + (y * pixels.Width); TColor color = quantized.Palette[Math.Min(palleteCount, quantized.Pixels[i])]; pixels[x, y] = color; } diff --git a/tests/ImageSharp.Tests/Formats/Png/PngTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngTests.cs index cf485c593f..5ba00eb4d3 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngTests.cs @@ -19,7 +19,7 @@ namespace ImageSharp.Tests [Fact] public void ImageCanSaveIndexedPng() { - string path = CreateOutputDirectory("Png"); + string path = CreateOutputDirectory("Png", "Indexed"); foreach (TestFile file in Files) {