So I wrote this code and my goal is to increase the red intensity by 50% in every pixel, help?
1 2 3 4 5 6 7 8 9 10 11 12 |
from PIL import Image im = Image. open ( 'monkey.jpg' ) img = im.copy() width, height = img.size red, green, blue = ( 0 , 0 , 0 ) for i in range (width): for j in range (height): pixel = img.getpixel((i,j)) red + = pixel[ 0 ] green + = pixel[ 1 ] blue + = pixel[ 2 ] newpixel = img.putpixel((i,j),(red * 2 ,green,blue)) |