function to crop image create background color
<p>i have this function, and when i pass a image which is smaller than the crop i want to create, it make bigger size image, thats all right, but the rest where there is no image, it fills with black color, do u know how to force it to create white, or specific color by using f.e. array(255,255,255) ??</p>

<p>here is picture it created for u to see directly what i mean.</p>

<p><img src="http://i.stack.imgur.com/aw1bi.jpg" alt="bed"></p>

<pre><code>public function crop($x, $y, $width, $height)
{
    $copy=imagecreatetruecolor($width,$height);
    //$this-&gt;img = imagecolorallocate($this-&gt;img, 23, 123, 456);
    if (imagecopy($copy, $this-&gt;img, 0, 0, $x, $y, $width, $height)) {
        $this-&gt;img=$copy;
        return true;
    }

    return false;
}
</code></pre>
