use GD; use Math::Complex; $img = new GD::Image(400,400); $black = $img->colorAllocate(0,0,0); $bl = $img->colorAllocate(0,0,50); $blue = $img->colorAllocate(0,0,50); $c = cplx(-0.70,-0.38); for($x=-200;$x<=200;$x++){ for($y=-200;$y<=200;$y++){ $z = cplx($x/100,$y/100); $teller = 0; che(); } } binmode STDOUT; print $img->png; sub che(){ $zz = $z**2 + $c; if(abs($zz)>2){ if($teller<=3){ $img->setPixel(200+$x,200+$y,$blue);} else{ $img->colorDeallocate($bl); $bl = $img->colorAllocate(0,0,25*$teller); $img->setPixel(200+$x,200+$y,$bl);} } elsif(abs($zz<2)){ if($teller<8){ $teller++; $z = $zz; che(); } } }