php imagecopyresized vs imagecopyresampled vs imagecopy pros/cons

雨燕双飞 提交于 2019-12-03 06:13:25

问题


These all seem to do the same thing. What are the pros/cons of each.

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

I'm resizing a user submitted image.

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

And now I want to copy the orginal image into the '$newImage'


回答1:


imagecopyresized will copy and scale and image. This uses a fairly primitive algorithm that tends to yield more pixelated results.

imagecopyresampled will copy and scale and image, it uses a smoothing and pixel interpolating algorithm that will generally yield much better results then imagecopyresized at the cost of a little cpu usage.

imagecopy will copy but will not scale the image.



来源:https://stackoverflow.com/questions/18004702/php-imagecopyresized-vs-imagecopyresampled-vs-imagecopy-pros-cons

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!