Created
February 17, 2021 15:38
-
-
Save BilHim/a0548037df94225410f4dfbbde358ba7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Brightness filter | |
| for x in range(width): | |
| for y in range(height): | |
| r, g, b = image.getpixel((x, y)) | |
| # d is the brightness increase | |
| r_ = truncate(r + d) | |
| g_ = truncate(g + d) | |
| b_ = truncate(b + d) | |
| new_pixel = (int(r_), int(g_), int(b_)) | |
| new_image.putpixel((x, y), new_pixel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment