问题
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:
- Python 32-bit from here.
- All in one 32-bit from here.
- 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