We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84eb9b3 commit 313a138Copy full SHA for 313a138
digital_image_processing/change_contrast.py
@@ -11,13 +11,13 @@
11
from PIL import Image
12
13
14
-def change_contrast(img, level: int):
+def change_contrast(img: Image, level: int) -> Image:
15
"""
16
Function to change contrast
17
18
factor = (259 * (level + 255)) / (255 * (259 - level))
19
20
- def contrast(c):
+ def contrast(c: int) -> int:
21
22
Fundamental Transformation/Operation that'll be performed on
23
every bit.
@@ -31,5 +31,5 @@ def contrast(c):
31
# Load image
32
img = Image.open("image_data/lena.jpg")
33
# Change contrast to 170
34
- cont_img = change_contrast(img, 170.0)
+ cont_img = change_contrast(img, 170)
35
cont_img.save("image_data/lena_high_contrast.png", format="png")
0 commit comments