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