I need to make an image out of two icons with transparent background on both of them.
The image will be placed on a ordinary image. Icon number one has a dynamic size , but icon number 2 has a static size.
This is how I want it to be:

And not like this:

The code i use is:
<?php
$icon1 = "icon1.png";//Dynamic size
$icon2 = "icon2.png";//Static size
//******************Load and resize the image
$ic1= imagecreatefrompng($icon1);
imagealphablending($ic1 ,true);
imagesavealpha($ic1 ,true);
$image = imagecreatetruecolor(300, 300);
//Transparent-magic!!
////////////////////////////
imagealphablending($image, false);
$colorTransparent = imagecolorallocatealpha($image,0,0,0, 127);
imagefill($image, 0, 0, $colorTransparent);
imagesavealpha($image, true);
//Copy and change size
imagecopyresampled($image, $ic1, 5, 5, 0, 0, 80, 80, imagesx($ic1), imagesy($ic1));
//Load the next icon
$ic2 = imagecreatefrompng($icon2);
//put icon2 on icon1
imagecopyresampled($image, $ic2,10, 10, 0, 0,imagesx($ic2),imagesy($ic2),imagesx($ic2), imagesy($ic2));
// Output and free free from memory, put the image on the green background( body backgrounds-image)
header('Content-Type: image/png');
imagepng($image);
imagedestroy($ic1);
imagedestroy($ic2);
imagedestroy($image);
?>
Thank you for any ideas!
Maria