Skip to content

Commit 313a138

Browse files
Add files via upload
1 parent 84eb9b3 commit 313a138

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

digital_image_processing/change_contrast.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
from PIL import Image
1212

1313

14-
def change_contrast(img, level: int):
14+
def change_contrast(img: Image, level: int) -> Image:
1515
"""
1616
Function to change contrast
1717
"""
1818
factor = (259 * (level + 255)) / (255 * (259 - level))
1919

20-
def contrast(c):
20+
def contrast(c: int) -> int:
2121
"""
2222
Fundamental Transformation/Operation that'll be performed on
2323
every bit.
@@ -31,5 +31,5 @@ def contrast(c):
3131
# Load image
3232
img = Image.open("image_data/lena.jpg")
3333
# Change contrast to 170
34-
cont_img = change_contrast(img, 170.0)
34+
cont_img = change_contrast(img, 170)
3535
cont_img.save("image_data/lena_high_contrast.png", format="png")

0 commit comments

Comments
 (0)