diff --git a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawPathProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawPathProcessor.cs index be702fb87..645e8b908 100644 --- a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawPathProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawPathProcessor.cs @@ -43,6 +43,10 @@ public DrawPathProcessor(ShapeGraphicsOptions options, IPen pen, IPath shape) /// public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel - => new FillRegionProcessor(this.Options, this.Pen.StrokeFill, new ShapePath(this.Shape, this.Pen)).CreatePixelSpecificProcessor(configuration, source, sourceRectangle); + { + // offset drawlines to align drawing outlines to pixel centers + var shape = this.Shape.Translate(0.5f, 0.5f); + return new FillRegionProcessor(this.Options, this.Pen.StrokeFill, new ShapePath(shape, this.Pen)).CreatePixelSpecificProcessor(configuration, source, sourceRectangle); + } } } diff --git a/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor{TPixel}.cs index 251ba585d..a4442970f 100644 --- a/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor{TPixel}.cs @@ -61,10 +61,8 @@ protected override void OnFrameApply(ImageFrame source) // basically if the line is [1,2] => [3,2] then when outlining at 1 we end up with a region of [0.5,1.5],[1.5, 1.5],[3.5,2.5],[2.5,2.5] // and this can cause missed fills when not using antialiasing.so we offset the pixel grid by 0.5 in the x & y direction thus causing the# // region to align with the pixel grid. - float offset = 0.5f; if (graphicsOptions.Antialias) { - offset = 0f; // we are antialiasing skip offsetting as real antialiasing should take care of offset. subpixelCount = graphicsOptions.AntialiasSubpixelDepth; if (subpixelCount < 4) { @@ -97,7 +95,7 @@ protected override void OnFrameApply(ImageFrame source) float yPlusOne = y + 1; for (float subPixel = y; subPixel < yPlusOne; subPixel += subpixelFraction) { - int pointsFound = region.Scan(subPixel + offset, buffer, configuration, shapeOptions.IntersectionRule); + int pointsFound = region.Scan(subPixel, buffer, configuration, shapeOptions.IntersectionRule); if (pointsFound == 0) { // nothing on this line, skip @@ -109,8 +107,8 @@ protected override void OnFrameApply(ImageFrame source) // points will be paired up float scanStart = buffer[point] - minX; float scanEnd = buffer[point + 1] - minX; - int startX = (int)MathF.Floor(scanStart + offset); - int endX = (int)MathF.Floor(scanEnd + offset); + int startX = (int)MathF.Floor(scanStart); + int endX = (int)MathF.Floor(scanEnd); if (startX >= 0 && startX < scanline.Length) { diff --git a/src/ImageSharp.Drawing/Shapes/Outliner.cs b/src/ImageSharp.Drawing/Shapes/Outliner.cs index b6b2e971c..af65a0179 100644 --- a/src/ImageSharp.Drawing/Shapes/Outliner.cs +++ b/src/ImageSharp.Drawing/Shapes/Outliner.cs @@ -75,7 +75,7 @@ public static IPath GenerateOutline(this IPath path, float width, ReadOnlySpanThe style to render the joints. /// The style to render the end caps of open paths (ignored on closed paths). /// A new path representing the outline. - public static IPath GenerateOutline(this IPath path, float width, JointStyle jointStyle = JointStyle.Square, EndCapStyle endCapStyle = EndCapStyle.Butt) + public static IPath GenerateOutline(this IPath path, float width, JointStyle jointStyle = JointStyle.Square, EndCapStyle endCapStyle = EndCapStyle.Square) { var offset = new ClipperOffset() { diff --git a/tests/ImageSharp.Drawing.Tests/Issues/Issue_28.cs b/tests/ImageSharp.Drawing.Tests/Issues/Issue_28.cs new file mode 100644 index 000000000..7ef0b8a51 --- /dev/null +++ b/tests/ImageSharp.Drawing.Tests/Issues/Issue_28.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.Drawing.Processing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; + +namespace SixLabors.ImageSharp.Drawing.Tests.Issues +{ + public class Issue_28 + { + private Rgba32 red = Color.Red.ToRgba32(); + + [Fact] + public void DrawingLineAtTopShouldDisplay() + { + using var image = new Image(Configuration.Default, 100, 100, Color.Black); + image.Mutate(x => x + .SetGraphicsOptions(g => g.Antialias = false) + .DrawLines( + this.red, + 1f, + new PointF(0, 0), + new PointF(100, 0) + )); + + var locations = Enumerable.Range(0, 100).Select(i => (x: i, y: 0)); + Assert.All(locations, l => + { + Assert.Equal(this.red, image[l.x, l.y]); + }); + } + + [Fact] + public void DrawingLineAtBottomShouldDisplay() + { + using var image = new Image(Configuration.Default, 100, 100, Color.Black); + image.Mutate(x => x + .SetGraphicsOptions(g => g.Antialias = false) + .DrawLines( + this.red, + 1f, + new PointF(0, 99), + new PointF(100, 99) + )); + + var locations = Enumerable.Range(0, 100).Select(i => (x: i, y: 99)); + Assert.All(locations, l => + { + Assert.Equal(this.red, image[l.x, l.y]); + }); + } + + [Fact] + public void DrawingLineAtLeftShouldDisplay() + { + using var image = new Image(Configuration.Default, 100, 100, Color.Black); + image.Mutate(x => x + .SetGraphicsOptions(g => g.Antialias = false) + .DrawLines( + this.red, + 1f, + new PointF(0, 0), + new PointF(0, 99) + )); + + var locations = Enumerable.Range(0, 100).Select(i => (x: 0, y: i)); + Assert.All(locations, l => + { + Assert.Equal(this.red, image[l.x, l.y]); + }); + } + + [Fact] + public void DrawingLineAtRightShouldDisplay() + { + using var image = new Image(Configuration.Default, 100, 100, Color.Black); + image.Mutate(x => x + .SetGraphicsOptions(g => g.Antialias = false) + .DrawLines( + this.red, + 1f, + new PointF(99, 0), + new PointF(99, 99) + )); + + var locations = Enumerable.Range(0, 100).Select(i => (x: 99, y: i)); + Assert.All(locations, l => + { + Assert.Equal(this.red, image[l.x, l.y]); + }); + } + } +} diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png deleted file mode 100644 index 57cb2e6da..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png deleted file mode 100644 index 346ea8b42..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png deleted file mode 100644 index 2ffa1e7e9..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png deleted file mode 100644 index 57cb2e6da..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png deleted file mode 100644 index e93fd5a60..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png deleted file mode 100644 index 2614a2f11..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png deleted file mode 100644 index df75d8d0d..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png deleted file mode 100644 index 81e6bb8d8..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png deleted file mode 100644 index 938514381..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png deleted file mode 100644 index db67d9ddd..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png deleted file mode 100644 index b428583f3..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png deleted file mode 100644 index db67d9ddd..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-False_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png deleted file mode 100644 index 57cb2e6da..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Add_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png deleted file mode 100644 index 346ea8b42..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Multiply_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png deleted file mode 100644 index 2ffa1e7e9..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-0.5_blenderMode-Normal_blendPercentage-1.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png deleted file mode 100644 index 57cb2e6da..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Add_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png deleted file mode 100644 index e93fd5a60..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Multiply_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png deleted file mode 100644 index 2614a2f11..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Blue_alpha-1_blenderMode-Normal_blendPercentage-0.5.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png deleted file mode 100644 index df75d8d0d..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Add_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png deleted file mode 100644 index 81e6bb8d8..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Multiply_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png deleted file mode 100644 index 938514381..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-Green_alpha-0.5_blenderMode-Normal_blendPercentage-0.3.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png deleted file mode 100644 index db67d9ddd..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Add_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png deleted file mode 100644 index b428583f3..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Multiply_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png b/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png deleted file mode 100644 index db67d9ddd..000000000 Binary files a/tests/Images/ReferenceOutput/Drawing/ClearSolidBrushTests/BlendFillColorOverBackground_triggerFillRegion-True_newColorName-HotPink_alpha-0.8_blenderMode-Normal_blendPercentage-0.8.png and /dev/null differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A150_T5.png b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A150_T5.png index 4883be10b..75755fe85 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A150_T5.png and b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A150_T5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A255_T5.png b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A255_T5.png index a79cdf3cb..02bbf9f0f 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A255_T5.png and b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_HotPink_A255_T5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_Red_A255_T3.png b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_Red_A255_T3.png index 89e9dd49c..e3295f574 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_Red_A255_T3.png and b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_Red_A255_T3.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T1.5.png b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T1.5.png index 3e5f4e923..8720f7920 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T1.5.png and b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T1.5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T15.png b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T15.png index 3e5f4e923..8720f7920 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T15.png and b/tests/Images/ReferenceOutput/Drawing/DrawBezierTests/DrawBeziers_White_A255_T15.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon.png b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon.png index bf0dfe002..1ac46c916 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon.png and b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Dashed.png b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Dashed.png index 6b5a31dac..a8772cc4c 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Dashed.png and b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Dashed.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Overlap.png b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Overlap.png index 5500f8301..8eb4e0a0c 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Overlap.png and b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Overlap.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Transparent.png b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Transparent.png index 2ba0d86b5..8b82ea597 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Transparent.png and b/tests/Images/ReferenceOutput/Drawing/DrawComplexPolygonTests/DrawComplexPolygon__Transparent.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDotDot_Rgba32_Black_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDotDot_Rgba32_Black_A(1)_T(5)_NoAntialias.png index a4455830b..05fe81817 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDotDot_Rgba32_Black_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDotDot_Rgba32_Black_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDot_Rgba32_Yellow_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDot_Rgba32_Yellow_A(1)_T(5)_NoAntialias.png index 2aa36b8cd..ae62212e6 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDot_Rgba32_Yellow_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_DashDot_Rgba32_Yellow_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dash_Rgba32_White_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dash_Rgba32_White_A(1)_T(5)_NoAntialias.png index 89e055651..09c2c92e4 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dash_Rgba32_White_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dash_Rgba32_White_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dot_Rgba32_LightGreen_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dot_Rgba32_LightGreen_A(1)_T(5)_NoAntialias.png index a76763125..843172a80 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dot_Rgba32_LightGreen_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Dot_Rgba32_LightGreen_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Bgr24_Yellow_A(1)_T(10).png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Bgr24_Yellow_A(1)_T(10).png index b98c552d4..a22566d69 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Bgr24_Yellow_A(1)_T(10).png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Bgr24_Yellow_A(1)_T(10).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(0.6)_T(10).png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(0.6)_T(10).png index bad292d9d..779bf3a46 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(0.6)_T(10).png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(0.6)_T(10).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(2.5).png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(2.5).png index 64f8ffb91..3539b4738 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(2.5).png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(2.5).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(5)_NoAntialias.png index 18c3c73ef..621db5350 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawLinesTests/DrawLines_Simple_Rgba32_White_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A150_T5.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A150_T5.png index cbe00ff70..937b30bc9 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A150_T5.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A150_T5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A255_T5.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A255_T5.png index 4b482f89a..d8070c47e 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A255_T5.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_HotPink_A255_T5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_Red_A255_T3.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_Red_A255_T3.png index 883e8e78d..0b31a0ed9 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_Red_A255_T3.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_Red_A255_T3.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T1.5.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T1.5.png index 50648c6c7..289663179 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T1.5.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T1.5.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T15.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T15.png index ef56a4b27..a2da72426 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T15.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/DrawPath_White_A255_T15.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/PathExtendingOffEdgeOfImageShouldNotBeCropped.png b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/PathExtendingOffEdgeOfImageShouldNotBeCropped.png index 5bc777b1c..62fe6aae9 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPathTests/PathExtendingOffEdgeOfImageShouldNotBeCropped.png and b/tests/Images/ReferenceOutput/Drawing/DrawPathTests/PathExtendingOffEdgeOfImageShouldNotBeCropped.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Bgr24_Yellow_A(1)_T(10).png b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Bgr24_Yellow_A(1)_T(10).png index 4eae176ed..49989139f 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Bgr24_Yellow_A(1)_T(10).png and b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Bgr24_Yellow_A(1)_T(10).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(0.6)_T(10).png b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(0.6)_T(10).png index e260caacd..e67a6fa0f 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(0.6)_T(10).png and b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(0.6)_T(10).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(2.5).png b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(2.5).png index e0b003b37..3b3ddc652 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(2.5).png and b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(2.5).png differ diff --git a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(5)_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(5)_NoAntialias.png index c36932691..3791495f9 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(5)_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/DrawPolygonTests/DrawPolygon_Rgba32_White_A(1)_T(5)_NoAntialias.png differ diff --git a/tests/Images/ReferenceOutput/Drawing/FillPolygonTests/FillPolygon_Solid_Rgba32_White_A1_NoAntialias.png b/tests/Images/ReferenceOutput/Drawing/FillPolygonTests/FillPolygon_Solid_Rgba32_White_A1_NoAntialias.png index 64c896add..b57c0b0b0 100644 Binary files a/tests/Images/ReferenceOutput/Drawing/FillPolygonTests/FillPolygon_Solid_Rgba32_White_A1_NoAntialias.png and b/tests/Images/ReferenceOutput/Drawing/FillPolygonTests/FillPolygon_Solid_Rgba32_White_A1_NoAntialias.png differ diff --git a/tests/Images/SnapShotOutput.ps1 b/tests/Images/SnapShotOutput.ps1 index e31a6414a..45c730a31 100644 --- a/tests/Images/SnapShotOutput.ps1 +++ b/tests/Images/SnapShotOutput.ps1 @@ -1,6 +1,6 @@ . "$PSScriptRoot\Helpers.ps1" # include all the helper methods -Install-ImageSharp -Version "1.0.0-unstable1152" -Source 'MyGet' +Install-ImageSharp -Version "1.0.0-rc0003" -Source 'NuGet' $pngEncoder = [SixLabors.ImageSharp.Formats.Png.PngEncoder]::new() $pngEncoder.CompressionLevel = 'BestCompression' @@ -14,7 +14,7 @@ foreach ($sourceFile in $pngs) { $path = $sourceFile.FullName try { $img = Get-ImageSharpImage $path - [string]$pathOutput = $path.Replace("\ActualOutput\", "\ReferenceOutput\") + [string]$pathOutput = $path.Replace("\ActualOutput\", "\ReferenceOutput\") $newFile = $img | Set-ImageSharpImage -Path $pathOutput -Encoder $pngEncoder $oldFile = Get-Item $path if ($newFile.Length -gt $oldFile.Length) { @@ -28,10 +28,10 @@ foreach ($sourceFile in $pngs) { finally { $img.Dispose() } - + } $all = $copiedCounter + $compressedCounter Write-Host "Copied $copiedCounter" Write-Host "Compressed $compressedCounter" -Write-Host "Processed $all" \ No newline at end of file +Write-Host "Processed $all"