Skip to content

Instantly share code, notes, and snippets.

@pixelcmtd
Last active July 25, 2025 19:01
Show Gist options
  • Select an option

  • Save pixelcmtd/ffde4dc63738fc139cf7f7a4a197ae02 to your computer and use it in GitHub Desktop.

Select an option

Save pixelcmtd/ffde4dc63738fc139cf7f7a4a197ae02 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
# this is just a small script to brighten an image by 30%,
# which should probably be done in plain gimp, but idc
from PIL import Image
from sys import argv, exit
if len(argv) < 3:
print('usage: {} [input] [output]'.format(argv[0]))
exit(1)
input = Image.open(argv[1]).convert(mode='L')
whitebytes = b''
for i in range(0, input.size[0] * input.size[1]):
whitebytes += b'\xff'
white = Image.frombytes(mode='L', size=input.size, data=whitebytes)
Image.blend(input, white, 0.3).save(argv[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment