image resize quality

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi Folk

I was just wondering if you do any "thumbnailing" (imagecopyresized) of  
images and if you have noticed that the quality is not always that great.

This is what I use:

        $source = imagecreatefromjpeg($filename);
        $thumb = imagecreatetruecolor($w[$portrait][$j],$h[$portrait][$j]);
        imagealphablending($thumb, false);
        $source = @imagecreatefromjpeg($filename);
         imagecopyresized($thumb, $source, 0, 82, 0, 0, $w[$portrait][$j],  
$h[$portrait][$j], $width, $height);
        @imagejpeg($thumb, $filename);

And the images come out rather pixilated...


Quoted text here. Click to load it

Re: image resize quality

windandwaves wrote:
Quoted text here. Click to load it

You're loading your source image twice.

Nicholas Sherlock

Re: image resize quality

Use imagecopyresampled instead of imagecopyresized and get rid of
imagealphablending unless you really need it.

Site Timeline