Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a Python-Fu script outside GIMP
#1
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?
Reply
#2
(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.
Is there a way to make my script autonomous from GIMP?

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).
Reply
#3
(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.
Is there a way to make my script autonomous from GIMP?

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).

I see. I would have preferred to use Python-fu, but I guess I'll go with Python+Pillow then.
Thanks!
Reply
#4
(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.
Is there a way to make my script autonomous from GIMP?

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).

I see. I would have preferred to use Python-fu, but I guess I'll go with Python+Pillow then.
Thanks!

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.
Reply
#5
(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).

I see. I would have preferred to use Python-fu, but I guess I'll go with Python+Pillow then.
Thanks!

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.

Yes: https://stackoverflow.com/questions/4443...0#44435560

But it is overkill in most cases.
Reply


Forum Jump: