OK, so I did it:
a) make a mess of your code :) b) get rid of enough black that I'm sure you have finished cna!
$image1=$image2=imagecreatefrompng('test1.png');
imagealphablending($image2, false);
imagesavealpha($image2, true);
$w=imagesx($image1);
$h=imagesy($image1);
$final = imagecreatetruecolor($w, $h);
$percent = 0.583;
$new_width = $w * $percent;
$new_height = $h * $percent;
$wshift = $w/8.5;
$hshift = $h/2.5;
$temp = imagecreatetruecolor($new_width, $new_height);
imagecopymerge ($final, $image1, 0,0,0,0, $w , $h , 100);
imagecopymerge ($temp, $image2, 0,0,0,0, $w, $h, 100);
$black2 = imagecolorallocate($temp, 0, 0, 0);
$backgroundColor = imagecolortransparent($temp, $black2);
imagecopyresized($final, $temp,$wshift,$hshift,0,0, $new_width, $new_height, $w, $h);
$black = imagecolorallocate($final, 0, 0, 0);
$backgroundColor = imagecolortransparent($final, $black);
imagepng($final, 'output8.png');
Hope you arrive soon - get back to day work for me :)