Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dwastberg committed Nov 22, 2019
1 parent 1824f72 commit 5664394
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Tests/test_imagechops.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def test_sanity(self):
ImageChops.blend(im, im, 0.5)
ImageChops.composite(im, im, im)

ImageChops.softlight(im,im)
ImageChops.hardlight(im,im)
ImageChops.overlay(im,im)
ImageChops.softlight(im, im)
ImageChops.hardlight(im, im)
ImageChops.overlay(im, im)

ImageChops.offset(im, 10)
ImageChops.offset(im, 10, 20)
Expand Down Expand Up @@ -353,10 +353,10 @@ def test_softlight(self):
# Act
new = ImageChops.softlight(im1, im2)

#Assert
self.assertEqual(new.getpixel((64,64)), (163,54,32) )
self.assertEqual(new.getpixel((15,100)), (1,1,3) )
# Assert
self.assertEqual(new.getpixel((64, 64)), (163, 54, 32))
self.assertEqual(new.getpixel((15, 100)), (1, 1, 3))

def test_hardlight(self):
# Arrange
im1 = Image.open("Tests/images/hopper.png")
Expand All @@ -365,9 +365,9 @@ def test_hardlight(self):
# Act
new = ImageChops.hardlight(im1, im2)

#Assert
self.assertEqual(new.getpixel((64,64)), (144,50,27) )
self.assertEqual(new.getpixel((15,100)), (1,1,2) )
# Assert
self.assertEqual(new.getpixel((64, 64)), (144, 50, 27))
self.assertEqual(new.getpixel((15, 100)), (1, 1, 2))

def test_overlay(self):
# Arrange
Expand All @@ -377,10 +377,10 @@ def test_overlay(self):
# Act
new = ImageChops.overlay(im1, im2)

#Assert
self.assertEqual(new.getpixel((64,64)), (159,50,27) )
self.assertEqual(new.getpixel((15,100)), (1,1,2) )
# Assert
self.assertEqual(new.getpixel((64, 64)), (159, 50, 27))
self.assertEqual(new.getpixel((15, 100)), (1, 1, 2))

def test_logical(self):
def table(op, a, b):
out = []
Expand Down
4 changes: 4 additions & 0 deletions src/PIL/ImageChops.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def screen(image1, image2):
image2.load()
return image1._new(image1.im.chop_screen(image2.im))


def softlight(image1, image2):
"""
Superimposes two images on top of each other using the Soft Light algorithm
Expand All @@ -149,6 +150,7 @@ def softlight(image1, image2):
image2.load()
return image1._new(image1.im.chop_softlight(image2.im))


def hardlight(image1, image2):
"""
Superimposes two images on top of each other using the Hard Light algorithm
Expand All @@ -160,6 +162,7 @@ def hardlight(image1, image2):
image2.load()
return image1._new(image1.im.chop_hardlight(image2.im))


def overlay(image1, image2):
"""
Superimposes two images on top of each other using the Overlay algorithm
Expand All @@ -171,6 +174,7 @@ def overlay(image1, image2):
image2.load()
return image1._new(image1.im.chop_overlay(image2.im))


def add(image1, image2, scale=1.0, offset=0):
"""
Adds two images, dividing the result by scale and adding the
Expand Down

0 comments on commit 5664394

Please sign in to comment.