Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- def makeanagliph(file, delta):
- image = Image.open(file)
- height, lenght = image.size
- resolution = Image.new("RGB", (height, lenght), (0,0,0))
- p = resolution.load()
- p1 = image.load()
- for i in range(height):
- for j in range(lenght):
- if i < delta:
- r,g,b = p1[i,j]
- p[i,j] = 0, g, b
- else:
- g,b = p1[i,j][1:]
- r = p1[i-delta, j][0]
- p[i,j] = r,g,b
- resolution.save("res.jpg")
- makeanagliph("1.jpg", 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement