Hi DigitalPoint members, I'm making a script for my friend using php gd and is stuck at this point here. He wants a 1px outline to the images generated using php gd, is this possible? NOTE: Image border isn't what he wants, he wants a 1px outline around the image itself. I know this is possible with text generated, but have no idea with images. I'm currently at a shop outside my house, thus will reply to those who helped me asap. Thanks!
Simplest way of doing it, if you need more customizable function, contact me header('Content-type: image/png'); $image = "your-image.jpg"; list ($width, $height, $imageType) = getimagesize($image); $newWidth = $width + 2; $newHeight = $height + 2; $oldImage = imagecreatefromjpeg($image); $newImage = imagecreatetruecolor($newWidth, $newHeight); $borderColor = imagecolorallocate($newImage, 255, 0, 0); imagefill($newImage, 0, 0, $borderColor); imagecopyresampled($newImage, $oldImage, 1, 1, 0, 0, $width, $height, $width, $height); imagepng($newImage); imagedestroy($newImage); PHP: