Using a Python-Fu script outside GIMP - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: Using a Python-Fu script outside GIMP (/Thread-Using-a-Python-Fu-script-outside-GIMP) |
Using a Python-Fu script outside GIMP - Leodip - 04-23-2020 I have an image with 5 placeholder texts, and I've written a python function (I just copy-paste it in the console and then call it as needed) to change those texts and automatically export the image with a custom name. It works great, but I was planning on using the same function without needing to open GIMP at all. Is there a way to make my script autonomous from GIMP? RE: Using a Python-Fu script outside GIMP - Ofnuts - 04-23-2020 (04-23-2020, 07:02 PM)Leodip Wrote: I have an image with 5 placeholder texts, and I've written a python function (I just copy-paste it in the console and then call it as needed) to change those texts and automatically export the image with a custom name. It works great, but I was planning on using the same function without needing to open GIMP at all. Not if you start from an XCF. Otherwise there are other image processing tools that are designed to be used from shell scripts (ImageMagick) or called from Python (ImageMagick again, or the Pillow library). RE: Using a Python-Fu script outside GIMP - Leodip - 04-23-2020 (04-23-2020, 08:15 PM)Ofnuts Wrote:(04-23-2020, 07:02 PM)Leodip Wrote: I have an image with 5 placeholder texts, and I've written a python function (I just copy-paste it in the console and then call it as needed) to change those texts and automatically export the image with a custom name. It works great, but I was planning on using the same function without needing to open GIMP at all. I see. I would have preferred to use Python-fu, but I guess I'll go with Python+Pillow then. Thanks! RE: Using a Python-Fu script outside GIMP - eric_h - 06-07-2021 (04-23-2020, 08:40 PM)Leodip Wrote:(04-23-2020, 08:15 PM)Ofnuts Wrote:(04-23-2020, 07:02 PM)Leodip Wrote: I have an image with 5 placeholder texts, and I've written a python function (I just copy-paste it in the console and then call it as needed) to change those texts and automatically export the image with a custom name. It works great, but I was planning on using the same function without needing to open GIMP at all. I'm sure there must exist a solution using PYTHONPATH and DYLD_LIBRARY_PATH to run a GIMP python-fu script that is stored elsewhere than the GIMP plug-ins directory... It would be very convenient. RE: Using a Python-Fu script outside GIMP - Ofnuts - 06-07-2021 (06-07-2021, 06:39 AM)eric_h Wrote:(04-23-2020, 08:40 PM)Leodip Wrote:(04-23-2020, 08:15 PM)Ofnuts Wrote: Not if you start from an XCF. Otherwise there are other image processing tools that are designed to be used from shell scripts (ImageMagick) or called from Python (ImageMagick again, or the Pillow library). Yes: https://stackoverflow.com/questions/44430081/how-to-run-python-scripts-using-gimpfu-from-windows-command-line/44435560#44435560 But it is overkill in most cases. |