#!/usr/bin/python import Image import math from zoom import * res_x=640 res_y=480 size = (res_x,res_y) im = Image.new('RGB',size) pix = im.load() iterations=int(math.log(4/(X_MAX-X_MIN))/(12*math.log(10))*10000+200) print("Calcul de l'image {} avec {} iterations ...".format(nom_fic,iterations)) for px in range(res_x): for py in range(res_y): n=0 x=X_MIN+px*(X_MAX-X_MIN)/res_x y=Y_MAX-py*(Y_MAX-Y_MIN)/res_y z=complex(x,y) z2=z while(abs(z)<2): z=z*z+z2 n+=1 if n>=iterations: break pix[px,py] = (0,n & 255,n >> 8) im.save(nom_fic)