Home Tutorial Php Phpgd PHP GD art


Share on Google+Share on Google+
PHP GD art
Posted on: November 11, 2009 at 12:00 AM
This example shows how to make art in php gd.




Header("Content-type: image/jpeg");

$im = imagecreate($width,$height);






for ($x=-100;$x<=100;$x++)


for ($sub=500;$sub<=10000;$sub+=500)



imagesetpixel ($im, ($centerx+$x), ($centery-$new), $blue);

imagesetpixel ($im, ($centery-$new),($centerx+$x) , $red);

imagesetpixel ($im, ($centerx-$x), ($centery-$new), $red);

imagesetpixel ($im, ($centery+$new),($centerx+$x) , $blue);






After running the program you will get the following output


Related Tags for PHP GD art:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 11, 2009

Recommend the tutorial

Advertisements Advertisements