开发者

Connect GIMP with PHP or Python

开发者 https://www.devze.com 2023-01-07 03:52 出处:网络
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.

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 se开发者_C百科rver


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.


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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号