Skip to content

Commit c1fdc61

Browse files
Dmytro Litvinovstokhos
Dmytro Litvinov
authored andcommitted
Fixes: TheAlgorithms#2404. Fix PIL DeprecationWarnings in pytest output (TheAlgorithms#2678)
1 parent 826ba2c commit c1fdc61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: digital_image_processing/change_contrast.py

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

1313

14-
def change_contrast(img: Image, level: float) -> Image:
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: int) -> float:
20+
def contrast(c: int) -> int:
2121
"""
2222
Fundamental Transformation/Operation that'll be performed on
2323
every bit.
2424
"""
25-
return 128 + factor * (c - 128)
25+
return int(128 + factor * (c - 128))
2626

2727
return img.point(contrast)
2828

0 commit comments

Comments
 (0)