Installing PyGIMP on Windows

泄露秘密 提交于 2019-12-12 12:04:42

问题


On the web, I can find various example on gimp scripting with python.

http://www.jamesh.id.au/software/pygimp/ http://www.gimp.org/docs/python/pygimp.html

We need to import the gimpfu module to get the examples to work. Where can we get the installer of PyGIMP on Windows? It seems the project is dead and the links are broken.


回答1:


PyGIMP is part of GIMP (GNU Image Manipulation Program) and can only work in together with it. For Linux distributions it is often found in a different package - but its code lies inside the GIMP code source, and on Windows it is installed alongside GIMP.

As far as I know, the GIMP 2.8 installer for Windows should come with all dependencies (Python interpreter included) for it to work - else all you need to do is to have the dependencies for it to work installed before installing GIMP.

These should be:

Python 2.5, 2.6 or 2.7 Python-gtk Pycairo

And finally GIMP itself.

Them, you can't just use pygimp as a standalone Python module - it has to be launched from within GIMP to be able to use the program libraries and code. It is relatively easy to create a script that would respond to xmlrpc or similar method, to stay quietly running awaiting requisitions from external scripts to process images with GIMP, tough.




回答2:


In order to develop Gimp scripts using Python-fu I have followed gimp users article, In short you need to download & install the following:

  1. Python 32-bit from here.
  2. All in one 32-bit from here.
  3. Gimp 2.6 32-bit from here.

Then you need to create your-plugin.py file in C:\Users\MyUsername.gimp-2.6\plug-ins

P.S: Restart your gimp after adding code or modifying your register() function in order to take effect each time.



来源:https://stackoverflow.com/questions/14592607/installing-pygimp-on-windows

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