diff --git a/bb.py b/bb.py new file mode 100644 index 0000000..31faa05 --- /dev/null +++ b/bb.py @@ -0,0 +1 @@ +a=[1,2,3] diff --git a/bb.pyc b/bb.pyc new file mode 100644 index 0000000..ca9fb2a Binary files /dev/null and b/bb.pyc differ diff --git a/hacheuur.py b/hacheuur.py index 2ce9ed5..a2552f7 100644 --- a/hacheuur.py +++ b/hacheuur.py @@ -4,7 +4,7 @@ # haacheuur 0.24 # port industriel de port la nouvelle - couleur - 60cm*30cm # image source : pln.jpg -# image rendue : pln..20150910-11h59m53s.jpg +# image obtenue : pln..20150910-11h59m53s.jpg import sys import Image @@ -19,61 +19,115 @@ import time # modifs du 30/10/2013 import ImageEnhance -#ouvertrure de l'image source et conversion en mode 1bit +#ouvertrure de l'image source et conversion en mode couleur 1bit im1 = Image.open(str(sys.argv[1])).convert('1') im2 = im1.copy() #rapport d'allongement de la nouvelle image par rapport à la largeur de l'image originale -allongement = 1 +allongement = 4 im3 = Image.new("RGBA",(im1.size[0], im1.size[1])) im4 = Image.new("RGBA",(im1.size[0]*allongement, im1.size[1])) Larg = im1.size[0] Haut = im1.size[1] +import pickle -for i in range(10): - # nombre aleatoire compris dans les limites de l'image - def randHaut(): return random.randint(0, im1.size[1]) +loadfile = True + +class Sequence: + def __init__(s): + randomCoupeHauteur = [] + s.randomCopyPosi =[] + s.proportions=[] + s.choix=[] + s.sizeOutput=None + s.sizeInput=None + +""" +seq = dict() +seq["randomCoupeHauteur"] = [] +seq["randomCopyPosi"] = [] +seq["proportions"] = [] +seq["choix"] = [] +seq["sizeOutput"]= im4.size +seq["sizeInput"] = im1.size +""" +if loadfile: + seq=pickle.load(open("test.pickle")) + +else : + seq=Sequence() + +for i in range(1): + # constitution de la liste des tranches horizontales # genre comme si qu'on avait un 16 pistes :) - randomCoupeHauteur = [0, \ - randHaut(),randHaut(),randHaut(),randHaut(),randHaut(), \ - randHaut(),randHaut(),randHaut(),randHaut(),randHaut(), \ - randHaut(),randHaut(),randHaut(),randHaut(),randHaut(), \ - randHaut(),randHaut(),randHaut(),randHaut(),randHaut(), \ - randHaut(),randHaut(),randHaut(),randHaut(),randHaut(), \ - im1.size[1]] - - # rangement des valeurs des plus petites au plus grandes - randomCoupeHauteur.sort() - - # DEBUG - liste = [] + # nombre aleatoire compris dans les limites de l'image + def randHaut(): + return random.randint(0, im1.size[1]) + if loadfile: + randomCoupeHauteur = seq.randomCoupeHauteur + + else: + randomCoupeHauteur = [0, \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + randHaut(),randHaut(),randHaut(),randHaut(), \ + im1.size[1]] + # rangement des valeurs des plus petites au plus grandes + randomCoupeHauteur.sort() + seq.randomCoupeHauteur = randomCoupeHauteur + # les hachures def Hacheur(haut, bas) : n=0 - + i=0 + #!!!!!!!!!! while n