Advertisement
here2share

# polygon_opacity.py

Sep 1st, 2018
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. # polygon_opacity.py
  2.  
  3. from PIL import Image, ImageDraw
  4.  
  5. img = Image.new('RGB', (100, 100))
  6. drw = ImageDraw.Draw(img, 'RGBA')
  7. drw.polygon([(50,100), (100, 0), (0, 0)], (255, 255, 0, 80))
  8. drw.polygon([(50, 0), (100, 100), (0, 100)], (0, 0, 255, 80))
  9.  
  10. img.save('c:\pydemo\out.png', 'PNG')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement