4096){$imgWidth = 4096;} $imgHeight = preg_replace('/[^0-9]/', '', $_GET['height']); if(empty($imgHeight)){$imgHeight = "433";} if($imgHeight > 2160){$imgHeight = 2160;} $gd = imagecreatetruecolor($imgWidth, $imgHeight); $black = imagecolorallocate($gd, 0, 0, 0); // Randomize translation $K_real = 0.233+((rand(1,8000)/71421)); $K_img = 0.505+((rand(1,9999)/142842)); $zoomFactor = (1-(rand(1,9999)/20000)); $minReal = -1.0*$zoomFactor; $maxReal = 2.0*$zoomFactor; $minImg = (-0.9-(rand(0,2)/10))*$zoomFactor; $maxImg = $minImg + ($maxReal-$minReal)*($imgHeight/$imgWidth); $c_real = $minReal + $x*($maxReal-$minReal)/($imgWidth-1); $c_img = $minReal - $y*($maxImg-$minImg)/($imgHeight-1); $Re_factor = ($maxReal-$minReal)/($imgWidth-1); $Im_factor = ($maxImg-$minImg)/($imgHeight-1); for($y=0;$y<$imgHeight;++$y){ $c_img = $maxImg - $y*$Im_factor; for($x=0;$x<$imgWidth;++$x){ $c_real = $minReal + $x*$Re_factor; $Z_real = $c_real; $Z_img = $c_img; $isInside = 1; for($i=0;$i<$maxIterations;++$i){ $Z_real2 = $Z_real*$Z_real; $Z_img2 = $Z_img*$Z_img; if(($Z_real2 + $Z_img2)>4){ $isInside = 0; break; } $Z_img = 2*$Z_real*$Z_img + $K_img; $Z_real = $Z_real2 - $Z_img2 + $K_real; } if($isInside){ imagesetpixel($gd, $x, $y, $black); } else{ $colorSet = imagecolorallocate($gd, ($i*$redColor), ($i*$greenColor), ($i*$blueColor)); imagesetpixel($gd, $x, $y, $colorSet); } } } header('Content-Type: image/png'); imagepng($gd); ?>