compare two images in PHP
<p>I want to compare two images in PHP. If they are 95% or above similar then the result should be just displaying text Yes. If they are not similar the result should be No.
So </p>

<pre><code>if ( ) 
{
echo "Yes";
}
else
{
echo "No";
}
</code></pre>

<p>Any way this is so far what I had found. <a href="http://pastebin.com/wgeu2DqE" rel="nofollow">http://pastebin.com/wgeu2DqE</a> 
I would like to give you where I found it but you would have to register.</p>

<p>Now I have this function to load image</p>

<pre><code>function LoadPNG($imgname)
{
    /* Attempt to open */
    $im = @imagecreatefrompng($imgname);

    /* See if it failed */
    if(!$im)
    {
        /* Create a blank image */
        $im  = imagecreatetruecolor(150, 30);
        $bgc = imagecolorallocate($im, 255, 255, 255);
        $tc  = imagecolorallocate($im, 0, 0, 0);

        imagefilledrectangle($im, 0, 0, 150, 30, $bgc);

        /* Output an error message */
        imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
    }

    return $im;
}
</code></pre>

<p>I've been trying on my notepad++ and phpdesigner to come up with something but I get errors. I am not a php developer so I am asking a help from you guys. I just need comparison between two images and Yes or No. So this is pretty easy. I saw this too but couldn't make sense out of it. </p>

<p><a href="http://stackoverflow.com/questions/3270929/compare-2-images-in-php">Compare 2 images in php</a></p>

<p>Thanks.</p>
