Skip to content

Commit

Permalink
Add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 31, 2024
1 parent 95e35f5 commit d2ec75a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3342,7 +3342,7 @@ def _open_core(fp, filename, prefix, formats):
# Image processing.


def alpha_composite(im1, im2):
def alpha_composite(im1: Image, im2: Image) -> Image:
"""
Alpha composite im2 over im1.
Expand All @@ -3357,7 +3357,7 @@ def alpha_composite(im1, im2):
return im1._new(core.alpha_composite(im1.im, im2.im))


def blend(im1, im2, alpha):
def blend(im1: Image, im2: Image, alpha: float) -> Image:
"""
Creates a new image by interpolating between two input images, using
a constant alpha::
Expand All @@ -3380,7 +3380,7 @@ def blend(im1, im2, alpha):
return im1._new(core.blend(im1.im, im2.im, alpha))


def composite(image1, image2, mask):
def composite(image1: Image, image2: Image, mask: Image) -> Image:
"""
Create composite image by blending images using a transparency mask.
Expand Down

0 comments on commit d2ec75a

Please sign in to comment.