X Tutup
The Wayback Machine - https://web.archive.org/web/20201126010733/https://github.com/TheAlgorithms/Python/pull/2678/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PIL DeprecationWarnings in pytest output #2678

Merged
merged 1 commit into from Oct 3, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -11,18 +11,18 @@
from PIL import Image


def change_contrast(img: Image, level: float) -> Image:
def change_contrast(img: Image, level: int) -> Image:
"""
Function to change contrast
"""
factor = (259 * (level + 255)) / (255 * (259 - level))

def contrast(c: int) -> float:
def contrast(c: int) -> int:
"""
Fundamental Transformation/Operation that'll be performed on
every bit.
"""
return 128 + factor * (c - 128)
return int(128 + factor * (c - 128))

return img.point(contrast)

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.
X Tutup