分类: LINUX
2013-06-02 21:22:16
最近在选择python的imagemagick的接口,但是选择不太多,默认的PIL功能不是太强大,另外的都不是太活跃。
正在不断测试中...
ImageMagick的python接口
- PythonMagick (BROKEN) the official bindings, and somewhat up-to-date (last update 2012-09-19), I could get it to compile, but it threw TypeErrors when trying to run. You can compile it like so:
./configure --prefix=/opt/local CPPFLAGS="-I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7" LDFLAGS=-L/opt/local/lib
- (BROKEN)
this shows up in searches, but it hasn’t been updated in 5 years. It’s as you can imagine, broken.
- (BROKEN)
last updated 2012-01-22, it includes a nice README (w/ the aforementioned history) and examples and I wanted it to work, alas, I couldn’t get it to.
- (WORKS!)
Wand is under active development (last commit 2013-01-31), is Pythonic, has community contributions, and works! Sounds perfect, right? Alas, it doesn’t support many features currently (layers, effects, animation etc) although it’s on the roadmap.
- (WORKS!)
This lib was the closest to doing what I needed. It’s very active (last commit 2013-02-10) and is much more comprehensive than Wand.. however, while supposedly working for ImageMagick, I could only get it working w/ GraphicsMagick, which in my case, was missing features that I needed. There are decent docs but very little real code out there. Here btw, is how I got it running (it has some boost issues; also, pip doesn’t work):
$ workon ELC # 在 virtualenv 环境 $ sudo apt-get install libmagick++-dev $ sudo apt-get install libboost-python-dev $ sudo apt-get install libgraphicsmagick++1-dev $ pip install pgmagick