Connect GIMP with PHP or Python

喜欢而已 提交于 2019-12-01 06:59:57

问题


is there any way to connect GIMP with python or PHP and use its libraries? It seems that all i can find on the web is pygimp which is not supported anymore.

ps. i do my development on mac and i use linux as a production server


回答1:


You can write GIMP plugins in Python (see, for example James Hestenridge's clothify, then call the plug-in from the command-line with a command of the form

gimp -i -b '(python-fu-bw-film RUN-NONINTERACTIVE "/path/to/filename.jpg" 0 1 FALSE FALSE FALSE FALSE FALSE FALSE)' -b '(gimp-quit 0)'

It's not exactly pretty, but it's possible. Here is another example.




回答2:


Probably not directly, but I'll bet you can access some functions via 'exec()' on the command line. What are you trying to do? Can the GD or ImageMagic tools help?




回答3:


One important thing regarding running gimp python plugin in batch mode. Option -i means no interface. But in gimp documentation there is another option with same explanation --no-interface. User could though that they have same effect. But when you try to run batch script on remote linux machine, with option -i you will get 'no display'. With option --no-interface, batch script will run without error. My colleague discovered that this is undocumented gimp 2.6.11 feature.

Regards, Karlo.



来源:https://stackoverflow.com/questions/3237252/connect-gimp-with-php-or-python

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