i wrote code with flips image and then rotate it at -60 degree, issue is that rotated parts background is more darker than original image.
used sample image is transparent png image
summary of what i did 1: i make white layer A 2: put image on layer A using imagecopyresampled 3: flipped layer A , rotated Layer A
image used :http://img10.deviantart.net/07aa/i/2013/058/2/7/png_branch_by_moonglowlilly-d5wdjdp.png
output image output image
$image1=imagecreatefrompng($_GET["v1"]);
$image2=imagecreatefrompng($_GET["v1"]);
//filter_opacity( $image1, 25 );
$w=imagesx($image1);
$h=imagesy($image1);
$finala = imagecreatetruecolor($w, $h);
$finalb = imagecreatetruecolor($w, $h);
$finalc = imagecreatetruecolor($w, $h);
$backgroundColora = imagecolorallocate($finala, 255,255,255); // white bg
$backgroundColorb = imagecolorallocate($finalb, 255,255,255); // white bg
$backgroundColorc = imagecolorallocate($finalc, 255,255,255); // white bg
imagefill($finala, 0, 0, $backgroundColora);
imagefill($finalb, 0, 0, $backgroundColorb);
imagefill($finalc, 0, 0, $backgroundColorc);
$percent = 0.583;
$new_width = $w * $percent;
$new_height = $h * $percent;
$wshift = $w/8.5;
$hshift = $h/2.5;
imagecopyresampled($finala, $image2,$wshift,$hshift,0,0, $new_width, $new_height, $w, $h);
imagecopyresampled($finalc, $image2,$wshift,$hshift,0,0, $new_width, $new_height, $w, $h);
imagecopyresampled($finalb, $finalc,$w*0.3,$h*0.3,0,0, $w*0.6, $h*0.6, $w, $h);
imageflip($finala, IMG_FLIP_HORIZONTAL );
$finala = imagerotate($finala, -60, imageColorAllocateAlpha($finala, 255, 255, 255, 127));
imagecopyresampled($finalb, $finala,-$w*0.1,-$h*0.1,0,$h*0.20, $new_width, $new_height, $w, $h);
header('Content-Type: image/jpeg');
imagejpeg($finalb);
imagedestroy($finala);
imagedestroy($image2);
imagedestroy($image1);
imagedestroy($final);