<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> import sys , Image <EOL> def makemandel ( mandelx , mandely , xbeg , xend , ybeg , yend , filename = None ) : <EOL> xa = - <NUM_LIT> <EOL> xb = <NUM_LIT:1.0> <EOL> ya = - <NUM_LIT> <EOL> yb = <NUM_LIT> <EOL> maxIt = <NUM_LIT> <EOL> image = Image . new ( "<STR_LIT>" , ( xend - xbeg , yend - ybeg ) ) <EOL> for y in range ( ybeg , yend ) : <EOL> cy = y * ( yb - ya ) / ( mandely - <NUM_LIT:1> ) + ya <EOL> for x in range ( xbeg , xend ) : <EOL> cx = x * ( xb - xa ) / ( mandelx - <NUM_LIT:1> ) + xa <EOL> c = complex ( cx , cy ) <EOL> z = <NUM_LIT:0> <EOL> for i in range ( maxIt ) : <EOL> if abs ( z ) > <NUM_LIT> : break <EOL> z = z * z + c <EOL> r = i % <NUM_LIT:4> * <NUM_LIT:16> <EOL> g = i % <NUM_LIT:6> * <NUM_LIT:16> <EOL> b = i % <NUM_LIT:16> * <NUM_LIT:16> <EOL> image . putpixel ( ( x - xbeg , y - ybeg ) , b * <NUM_LIT> + g * <NUM_LIT> + r ) <EOL> if filename is not None : <EOL> image . save ( filename , "<STR_LIT>" ) <EOL> else : <EOL> image . save ( "<STR_LIT>" % ( xbeg , xend , ybeg , yend ) , "<STR_LIT>" ) <EOL> return image <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) < <NUM_LIT:6> : <EOL> print "<STR_LIT>" % __file__ <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> imgX = int ( sys . argv [ <NUM_LIT:1> ] ) <EOL> imgY = int ( sys . argv [ <NUM_LIT:2> ] ) <EOL> xBeg = int ( sys . argv [ <NUM_LIT:3> ] ) <EOL> xEnd = int ( sys . argv [ <NUM_LIT:4> ] ) <EOL> yBeg = int ( sys . argv [ <NUM_LIT:5> ] ) <EOL> yEnd = int ( sys . argv [ <NUM_LIT:6> ] ) <EOL> filename = None <EOL> if len ( args ) == <NUM_LIT:7> : <EOL> filename = str ( sys . argv [ <NUM_LIT:7> ] ) <EOL> makemandel ( imgX , imgY , xBeg , xEnd , yBeg , yEnd , filename ) <EOL> sys . exit ( <NUM_LIT:0> ) </s>
