diff --git a/Tests/images/imagedraw_outline_chord_L.png b/Tests/images/imagedraw_outline_chord_L.png new file mode 100644 index 000000000..9c20ad217 Binary files /dev/null and b/Tests/images/imagedraw_outline_chord_L.png differ diff --git a/Tests/images/imagedraw_outline_chord_RGB.png b/Tests/images/imagedraw_outline_chord_RGB.png new file mode 100644 index 000000000..9e9cb5af0 Binary files /dev/null and b/Tests/images/imagedraw_outline_chord_RGB.png differ diff --git a/Tests/images/imagedraw_outline_ellipse_L.png b/Tests/images/imagedraw_outline_ellipse_L.png new file mode 100644 index 000000000..53b76b62b Binary files /dev/null and b/Tests/images/imagedraw_outline_ellipse_L.png differ diff --git a/Tests/images/imagedraw_outline_ellipse_RGB.png b/Tests/images/imagedraw_outline_ellipse_RGB.png new file mode 100644 index 000000000..37a519327 Binary files /dev/null and b/Tests/images/imagedraw_outline_ellipse_RGB.png differ diff --git a/Tests/images/imagedraw_outline_pieslice_L.png b/Tests/images/imagedraw_outline_pieslice_L.png new file mode 100644 index 000000000..92972d54c Binary files /dev/null and b/Tests/images/imagedraw_outline_pieslice_L.png differ diff --git a/Tests/images/imagedraw_outline_pieslice_RGB.png b/Tests/images/imagedraw_outline_pieslice_RGB.png new file mode 100644 index 000000000..4be4fc4af Binary files /dev/null and b/Tests/images/imagedraw_outline_pieslice_RGB.png differ diff --git a/Tests/images/imagedraw_outline_polygon_L.png b/Tests/images/imagedraw_outline_polygon_L.png new file mode 100644 index 000000000..57ed9d43b Binary files /dev/null and b/Tests/images/imagedraw_outline_polygon_L.png differ diff --git a/Tests/images/imagedraw_outline_polygon_RGB.png b/Tests/images/imagedraw_outline_polygon_RGB.png new file mode 100644 index 000000000..286b71c23 Binary files /dev/null and b/Tests/images/imagedraw_outline_polygon_RGB.png differ diff --git a/Tests/images/imagedraw_outline_rectangle_L.png b/Tests/images/imagedraw_outline_rectangle_L.png new file mode 100644 index 000000000..b9c47018f Binary files /dev/null and b/Tests/images/imagedraw_outline_rectangle_L.png differ diff --git a/Tests/images/imagedraw_outline_rectangle_RGB.png b/Tests/images/imagedraw_outline_rectangle_RGB.png new file mode 100644 index 000000000..41b92fb75 Binary files /dev/null and b/Tests/images/imagedraw_outline_rectangle_RGB.png differ diff --git a/Tests/images/imagedraw_outline_shape_L.png b/Tests/images/imagedraw_outline_shape_L.png new file mode 100644 index 000000000..20ebef157 Binary files /dev/null and b/Tests/images/imagedraw_outline_shape_L.png differ diff --git a/Tests/images/imagedraw_outline_shape_RGB.png b/Tests/images/imagedraw_outline_shape_RGB.png new file mode 100644 index 000000000..6fb6f623e Binary files /dev/null and b/Tests/images/imagedraw_outline_shape_RGB.png differ diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index a79a75ca0..62b11e98c 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -572,6 +572,47 @@ class TestImageDraw(PillowTestCase): draw.textsize("\n") draw.textsize("test\n") + def test_same_color_outline(self): + # Prepare shape + x0, y0 = 5, 5 + x1, y1 = 5, 50 + x2, y2 = 95, 50 + x3, y3 = 95, 5 + + s = ImageDraw.Outline() + s.move(x0, y0) + s.curve(x1, y1, x2, y2, x3, y3) + s.line(x0, y0) + + # Begin + for mode in ["RGB", "L"]: + for fill, outline in [ + ["red", None], + ["red", "red"], + ["red", "#f00"] + ]: + for operation, args in { + 'chord':[BBOX1, 0, 180], + 'ellipse':[BBOX1], + 'shape':[s], + 'pieslice':[BBOX1, -90, 45], + 'polygon':[[(18, 30), (85, 30), (60, 72)]], + 'rectangle':[BBOX1] + }.items(): + # Arrange + im = Image.new(mode, (W, H)) + draw = ImageDraw.Draw(im) + + # Act + draw_method = getattr(draw, operation) + args += [fill, outline] + draw_method(*args) + + # Assert + expected = ("Tests/images/imagedraw_outline" + "_{}_{}.png".format(operation, mode)) + self.assert_image_similar(im, Image.open(expected), 1) + if __name__ == '__main__': unittest.main()