调用 ImageMagick 进行图像操作的 PHP 类库 - phMagick
openkk
13年前
phMagick 是为 PHP 编写的用来调用 ImageMagick 程序进行图像操作的 PHP 类库。
Features highlight
- Not being limited by your host php memory settings
- PHP5 ready
- Plugin based, it's now easy to extend phMagick, or to include just the features you want
- Image reflection effect
- Better debug support, now you get the ImageMagick error messages
- Photoshop like image enhancements (noise, sharpen, smoth, sharpen, contrast, etc…)
- Glow effect, put an "aura" all around the image
- On the fly (or run time) thumbnail generation
- Draw text
- Add watermarks
- Create tab strips
- Resize Images and Convert to another format
- Smart Crop
- Common Image manipulation functions (invert, colors, rotate, flip & flop, etc)
- Advanced Image manipulation functions (levels, noise, sharpen, etc)
- Thumbnails from PDF and video files
- Polaroid effect
- Rounded Corners
- Drop Shaddow
下面是一段使用的代码:
/* ----------- TEXT 1 ----------- */ fontSize(48) ->font('Arial.ttf') ->color('#464646'); $phMagick = new phMagick('','watermark1.png');$phMagick->fromString('phMagick Rules',$format);//draw the text!! /* ----------- TEXT 2 ----------- */ $format = new phMagickTextObject();$format->fontSize(18) ->font('Arial.ttf') ->color('#f00') ->background('yellow'); //we can also set up a background color $phMagick = new phMagick('','watermark2.png');$phMagick->fromString('\nphMagick Rules\n', $format); //and use line breaks /* ----------- TEXT 3 ----------- */ $phMagick = new phMagick('','watermark3.png'); $format = new phMagickTextObject();$format->fontSize(38) ->font('Arial.ttf') ->color('#464646') ->background('#c0c0c0'); $phMagick->fromString('phMagick Rules', $format);