I have been searching relevant strings for days, but couldn't find a good answer for me. my problem is how I can draw a transparent red rectangle on top of a blue rectangle. Here is how i am doing now.
im=Image.new('RGBA',(400,400),'white')
draw=ImageDraw.Draw(im)
draw.rectangle((100,100,200,200),fill=(0,255,0,0)) #big 100*100 green rectangle
draw.rectangle((80,80,130,130),fill=(255,0,0,0)) #small 50*50 red rectangle
im.show()
what I got now is the read rectangle totally cover overlapping part of the green one, but I want overlapping part be transparent, so that I can see under the red rectangle it is the part of green one and the overlapping part will be another color.
Any help would be appreciated!