diff --git a/PIL/ImageFilter.py b/PIL/ImageFilter.py index fed165831..e3b867737 100644 --- a/PIL/ImageFilter.py +++ b/PIL/ImageFilter.py @@ -154,7 +154,7 @@ class GaussianBlur(Filter): self.effective_scale = effective_scale def filter(self, image): - return image.gaussian_blur(self.radius, self.effective_scale) + return image.gaussian_blur(self.radius, self.effective_scale or 2.6) class UnsharpMask(Filter): diff --git a/Tests/test_imageops_usm.py b/Tests/test_imageops_usm.py index 5164af015..4645b3d6e 100644 --- a/Tests/test_imageops_usm.py +++ b/Tests/test_imageops_usm.py @@ -66,15 +66,15 @@ class TestImageOpsUsm(PillowTestCase): def test_blur_accuracy(self): - i = snakes._new(ImageOps.gaussian_blur(snakes, 1)) + i = snakes._new(ImageOps.gaussian_blur(snakes, .7)) # Alpha channel must match whole. self.assertEqual(i.split()[3], snakes.split()[3]) # These pixels surrounded with pixels with 255 intensity. - # They must be 255. + # They must be very close to 255. for x, y, c in [(1, 0, 1), (2, 0, 1), (7, 8, 1), (8, 8, 1), (2, 9, 1), (7, 3, 0), (8, 3, 0), (5, 8, 0), (5, 9, 0), (1, 3, 0), (4, 3, 2), (4, 2, 2)]: - self.assertEqual(i.im.getpixel((x, y))[c], 255) + self.assertGreaterEqual(i.im.getpixel((x, y))[c], 250) # Fuzzy match. gp = lambda x, y: i.im.getpixel((x, y)) self.assertTrue(211 <= gp(7, 4)[0] <= 213)