We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b3f7c3 commit 5903948Copy full SHA for 5903948
digital_image_processing/change_contrast.py
@@ -11,18 +11,18 @@
11
from PIL import Image
12
13
14
-def change_contrast(img: Image, level: float) -> Image:
+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: int) -> float:
+ def contrast(c: int) -> int:
21
22
Fundamental Transformation/Operation that'll be performed on
23
every bit.
24
25
- return 128 + factor * (c - 128)
+ return int(128 + factor * (c - 128))
26
27
return img.point(contrast)
28
0 commit comments