Php imagecopyresized vs imagecopyresampled vs imagecopy pros / cons

It all seems the same. What are the pros and cons of each.

imagecopyresized () vs imagecopyresampled () vs imagecopy ().

I am resizing the image submitted by the user.

So, I have an image wrapper created using '$ newImage = imagecreatetruecolor (250, 250)'.

And now I want to copy the original image to '$ newImage'

+42
php image copy gd
Aug 01 '13 at 21:14
source share
1 answer

imagecopyresized will copy, scale and image. This uses a rather primitive algorithm, which tends to produce more pixelated results.

imagecopyresampled will copy, scale and image, it uses a smoothing and pixel interpolation algorithm, which usually gives much better results, and then imagecopyresized at the cost of a little CPU usage.

imagecopy will copy but will not scale the image.

+92
Aug 01 '13 at 21:37
source share



All Articles