Ce projet essai, en partant d'une IMAGESOURCE de : - appliquer des effets à l'image - la redimmensionner - changer son mode de couleur - la HAACHEER...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

motif.py 700B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # coding: utf-8
  3. import sys
  4. import Image
  5. import random
  6. import os
  7. import ImageDraw
  8. import ImageFont
  9. import ImageFilter
  10. from time import gmtime, strftime
  11. # MILLISECONDES
  12. from datetime import datetime
  13. dt = datetime.now()
  14. dt.microsecond
  15. heure = str(dt.hour)+"h"+str(dt.minute)+"m"+str(dt.second)+"s"+str(dt.microsecond)+"ms"
  16. image = Image.new("1", (512,512,), "white")
  17. h = image.size[0]
  18. l = image.size[1]
  19. img = ImageDraw.Draw(image)
  20. n = 0
  21. ecart = 4
  22. tranches = h / ecart
  23. while n < tranches :
  24. rx = random.randint(0,l/2)
  25. img.rectangle(((rx,n*tranches),(rx+l/2,n*tranches+tranches)),"white")
  26. n = n + 1
  27. img.save(heure+".png",'PNG', quality=100)
  28. def txt(strii):
  29. print strii