Merge images with PHP
<p>I have written a code for merge two images.</p>

<p>My code is:</p>

<pre><code>$rnd = rand("99000", "99999");

$dst_path = "/home/maxioutl/public_html/images/urunler/";
$dst_file_name = "tresim-{$rnd}.jpg";
$dst_file = $dst_path.$dst_file_name;

$dst = imagecreatetruecolor(250, 375);
imagefill($dst, 0, 0, imagecolorallocate($dst, 255, 255, 255));

$src = imagecreatefromjpeg("http://www.goldstore.com.tr/upload/product/raw/3.72925.0332.JPG");

imagecopymerge($dst, $src, 40, 60, 0, 0, 250, 375, 100);

imagejpeg($dst, $dst_file, 90);
</code></pre>

<p>Result:</p>

<p><img src="http://i.stack.imgur.com/R94Du.jpg" alt="black bg">
Black background. Where is it?</p>
