diff --git a/Tests/test_imagechops.py b/Tests/test_imagechops.py index 022c7256765..3378b6bd049 100644 --- a/Tests/test_imagechops.py +++ b/Tests/test_imagechops.py @@ -38,8 +38,8 @@ def test_sanity(): ImageChops.blend(im, im, 0.5) ImageChops.composite(im, im, im) - ImageChops.softlight(im, im) - ImageChops.hardlight(im, im) + ImageChops.soft_light(im, im) + ImageChops.hard_light(im, im) ImageChops.overlay(im, im) ImageChops.offset(im, 10) @@ -366,26 +366,26 @@ def test_subtract_modulo_no_clip(): self.assertEqual(new.getpixel((50, 50)), (241, 167, 127)) -def test_softlight(self): +def test_soft_light(self): # Arrange im1 = Image.open("Tests/images/hopper.png") im2 = Image.open("Tests/images/hopper-XYZ.png") # Act - new = ImageChops.softlight(im1, im2) + new = ImageChops.soft_light(im1, im2) # Assert self.assertEqual(new.getpixel((64, 64)), (163, 54, 32)) self.assertEqual(new.getpixel((15, 100)), (1, 1, 3)) -def test_hardlight(self): +def test_hard_light(self): # Arrange im1 = Image.open("Tests/images/hopper.png") im2 = Image.open("Tests/images/hopper-XYZ.png") # Act - new = ImageChops.hardlight(im1, im2) + new = ImageChops.hard_light(im1, im2) # Assert self.assertEqual(new.getpixel((64, 64)), (144, 50, 27)) diff --git a/docs/reference/ImageChops.rst b/docs/reference/ImageChops.rst index 31142cc3fd2..fb742254903 100644 --- a/docs/reference/ImageChops.rst +++ b/docs/reference/ImageChops.rst @@ -36,8 +36,8 @@ operations in this module). .. autofunction:: PIL.ImageChops.logical_or .. autofunction:: PIL.ImageChops.logical_xor .. autofunction:: PIL.ImageChops.multiply -.. autofunction:: PIL.ImageChops.softlight -.. autofunction:: PIL.ImageChops.hardlight +.. autofunction:: PIL.ImageChops.soft_light +.. autofunction:: PIL.ImageChops.hard_light .. autofunction:: PIL.ImageChops.overlay .. py:method:: PIL.ImageChops.offset(image, xoffset, yoffset=None) diff --git a/src/PIL/ImageChops.py b/src/PIL/ImageChops.py index 1dc456156c8..2d13b529fef 100644 --- a/src/PIL/ImageChops.py +++ b/src/PIL/ImageChops.py @@ -139,7 +139,7 @@ def screen(image1, image2): return image1._new(image1.im.chop_screen(image2.im)) -def softlight(image1, image2): +def soft_light(image1, image2): """ Superimposes two images on top of each other using the Soft Light algorithm @@ -148,10 +148,10 @@ def softlight(image1, image2): image1.load() image2.load() - return image1._new(image1.im.chop_softlight(image2.im)) + return image1._new(image1.im.chop_soft_light(image2.im)) -def hardlight(image1, image2): +def hard_light(image1, image2): """ Superimposes two images on top of each other using the Hard Light algorithm @@ -160,7 +160,7 @@ def hardlight(image1, image2): image1.load() image2.load() - return image1._new(image1.im.chop_hardlight(image2.im)) + return image1._new(image1.im.chop_hard_light(image2.im)) def overlay(image1, image2): diff --git a/src/_imaging.c b/src/_imaging.c index 7875ae27817..f40b19e4dfa 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -2407,7 +2407,7 @@ _chop_subtract_modulo(ImagingObject* self, PyObject* args) } static PyObject* -_chop_softlight(ImagingObject* self, PyObject* args) +_chop_soft_light(ImagingObject* self, PyObject* args) { ImagingObject* imagep; @@ -2418,7 +2418,7 @@ _chop_softlight(ImagingObject* self, PyObject* args) } static PyObject* -_chop_hardlight(ImagingObject* self, PyObject* args) +_chop_hard_light(ImagingObject* self, PyObject* args) { ImagingObject* imagep; @@ -3357,8 +3357,8 @@ static struct PyMethodDef methods[] = { {"chop_and", (PyCFunction)_chop_and, 1}, {"chop_or", (PyCFunction)_chop_or, 1}, {"chop_xor", (PyCFunction)_chop_xor, 1}, - {"chop_softlight", (PyCFunction)_chop_softlight, 1}, - {"chop_hardlight", (PyCFunction)_chop_hardlight, 1}, + {"chop_soft_light", (PyCFunction)_chop_soft_light, 1}, + {"chop_hard_light", (PyCFunction)_chop_hard_light, 1}, {"chop_overlay", (PyCFunction)_chop_overlay, 1}, #endif