图像处理库 gd
Yeah, I'm a Photoshop wizard. I rock the selection tool. I crop like a farmer. I dominate the bucket tool. Hell, I even went as far as wielding the wizard wand selection tool once.
是的,我是Photoshop向导。 我摇摆选择工具。 我像农夫一样种庄稼。 我主导了存储桶工具。 地狱,我什至甚至挥舞过一次魔杖选择工具。
...OK I'm rubbish when it comes to Photoshop. I avoid opening the memory pig whenever possible. Many times I even need to automate image manipulation on customer websites. Luckily for a nerd like me, PHP's GD library allows me to systematically execute basic image manipulations without the need for Photoshop, GIMP, or other desktop tools.
...好,关于Photoshop,我很垃圾。 我避免尽可能打开内存管。 很多时候,我什至需要在客户网站上自动化图像处理。 幸运的是,对于像我这样的书呆子,PHP的GD库使我可以系统地执行基本的图像操作,而无需使用Photoshop,GIMP或其他桌面工具。
PHP-颜色从灰度 (The PHP -- Color to Greyscale)
//to black and whiteif(!file_exists('dw-bw.png')) { $img = imagecreatefrompng('dw-manipulate-me.png'); imagefilter($img,IMG_FILTER_GRAYSCALE); imagepng($img,'db-bw.png'); imagedestroy($img);}
PHP-颜色变为负数 (The PHP -- Color to Negative)
//to negativeif(!file_exists('dw-negative.png')) { $img = imagecreatefrompng('dw-manipulate-me.png'); imagefilter($img,IMG_FILTER_NEGATE); imagepng($img,'db-negative.png'); imagedestroy($img);}
PHP-棕褐色的颜色 (The PHP -- Color to Sepia)
//to black and white, then sepiaif(!file_exists('dw-sepia.png')) { $img = imagecreatefrompng('dw-manipulate-me.png'); imagefilter($img,IMG_FILTER_GRAYSCALE); imagefilter($img,IMG_FILTER_COLORIZE,100,50,0); imagepng($img,'db-sepia.png'); imagedestroy($img);}
As you can see, PHP's GD library is a very competent, useful library. Though image libraries like ImageMagick get more credit than GD, GD is more than enough for the majority of designers and developers. Be sure to check out -- you can emboss images, fade images, and much more!
如您所见,PHP的GD库是一个非常有用的有用的库。 尽管像ImageMagick这样的图像库比GD获得更多的信誉,但是GD对于大多数设计人员和开发人员来说绰绰有余。 一定要检查 -您可以压印图像,淡化图像等等!
翻译自:
图像处理库 gd