int imagesetpixel
ImageSetPixelは画像im上にcol色で座標(x,y)(左上が0, 0)に点を 描画します。
imagecreateおよび imagecolorallocateも参考にしてください。