Skip to content

Instantly share code, notes, and snippets.

@BilHim
Created February 17, 2021 15:38
Show Gist options
  • Select an option

  • Save BilHim/a0548037df94225410f4dfbbde358ba7 to your computer and use it in GitHub Desktop.

Select an option

Save BilHim/a0548037df94225410f4dfbbde358ba7 to your computer and use it in GitHub Desktop.
# 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