1# Importing Image from PIL package
2from PIL import Image
3
4# creating a image object
5image = Image.open(r'C:\Users\System-Pc\Desktop\python.png')
6
7width, height = image.size
8
9for x in range(height):
10 image.putpixel( (x, x), (0, 0, 0, 255) )
11
12image.show()