imagesetpixel() draws a pixel at the specified coordinate.
PHP imagesetpixel() function has the following syntax.
bool imagesetpixel ( resource $image , int $x , int $y , int $color )
PHP imagesetpixel() function has the following parameters.
Returns TRUE on success or FALSE on failure.
<?php
$myImage = imagecreatetruecolor( 200, 100 );
$myGray = imagecolorallocate( $myImage, 204, 204, 204 );
$myBlack = imagecolorallocate( $myImage, 0, 0, 0 );
imagesetpixel( $myImage, 120, 60, $myBlack );
header( "Content-type: image/png" );
imagepng( $myImage );
imagedestroy( $myImage );
?>