Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_ImageChops_RGBA.py
- from Tkinter import Tk, Canvas, Label
- import ImageDraw, ImageChops, Image, ImageTk
- image1 = Image.new("RGBA", (500, 500), color=0)
- image2 = Image.new("RGBA", (500, 500), color=0)
- image3 = Image.new("RGBA", (500, 500), color=0)
- draw1 = ImageDraw.Draw(image1)
- draw2 = ImageDraw.Draw(image2)
- draw3 = ImageDraw.Draw(image3)
- draw1.ellipse([10, 150, 300, 440], (128,0,0))
- draw2.ellipse([150, 150, 440, 440], (0,0,128))
- draw3.ellipse([75, 10, 375, 300], (0,128,0))
- out = ImageChops.add(image1,image2,0.5)
- out = ImageChops.add(out,image3,0.5)
- win2 = Tk()
- photo = ImageTk.PhotoImage(out)
- label = Label(win2, image=photo)
- label.pack()
- win2.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement