I have created a script where I am placing an image in the center of another image using the PHP GD library. After that I've placed a PNG frame above that center placed image.
I now want to a give that image a 3D effect, or some shadow around the edges will work for me. How can I do that ?
// Get Product Image sizes
list($width, $height) = getimagesize($filename);
// Load
$source = imagecreatefromjpeg($filename);
// Output
if(isset($frame_image) && !empty($frame_image))
{
$png = imagecreatefrompng($frame_image);
list($newwidthf, $newheightf) = getimagesize($frame_image);
$out = imagecreatetruecolor($width, $height);
imagecopyresampled($out, $source, 0, 0, 0, 0, $width, $height, $width, $height);
imagecopyresampled($out, $png,0, 0, 0, 0, $width, $height, $newwidthf, $newheightf);
$final = imagejpeg($out);
}
else
{
$final = imagejpeg($source);
}
Here is the image which I have generated: