Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image, ImageDraw
- im = Image.open("mashinka.jpg")
- pixels = im.load() # список с пикселями
- x, y = im.size # ширина (x) и высота (y) изображения
- for i in range(x):
- for j in range(y):
- pixels[i,j] = (0, pixels[i, j][-2], pixels[i,j][-1])
- im.save("res.jpg")
- im = Image.open("mashinka.jpg")
- pixels = im.load() # список с пикселями
- x, y = im.size # ширина (x) и высота (y) изображения
- for i in range(x):
- for j in range(y):
- pixels[i,j] = (pixels[i, j][0], 0, 0)
- im.save("res1.jpg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement