#!/usr/bin/env python #-*- encoding: utf-8 -*- # # FILE.py # DESC # # Copyright (c) 2008 Pierre "delroth" Bourdon # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -*- coding: iso8859-1 -*- import Image import ImageDraw ##Cree une nouvelle image blanche de 400x400 en RGB im = Image.new("RGB", (400, 400), (255, 255, 255)) updt = ImageDraw.Draw(im) imax = 10 for a in xrange(400): a_ = a / 200.0 - 1.0 for b in xrange(400): b_ = b / 200.0 - 1.0 x = y = 0 for i in xrange (imax): x,y = x*x-y*y+a_, 2*x*y + b_ draw = True if x**2 + y**2 > 4: draw = False break if draw: im.putpixel((a, b), (0, 0, 0)) ##im.putpixel((200, 200), (0, 0, 0)) ##updt.line((0, 0, 400, 400), (0, 0, 0)) im.save("foo.jpg")