GIMP Chat
http://gimpchat.com/

Can a python script use gimpfu, run from terminal, and create new img?
http://gimpchat.com/viewtopic.php?f=9&t=19809
Page 1 of 1

Author:  ransa202 [ Thu Feb 03, 2022 11:29 pm ]
Post subject:  Can a python script use gimpfu, run from terminal, and create new img?

I want to make a python script that will use gimp for some of the processing steps and export as jpeg/png.
In my limited google searching, they say python scripts need to be run inside gimp and cannot be used from the terminal.
..But, I'm having a hard time believing that.

I was planning to create a python file that will look through some folders of images, read some metadata of preferences from a csv, with gimp modify the image sizes, put images side by side (in a grid) according to some preferences, output as a single png in another relative path location

Can I use gimpfu from within a larger python file from the terminal to do this? and if so, are there tutorials/documents for this?

Thanks

Current version of gimp 2.10.14, python 3.7.4

Author:  ofnuts [ Fri Feb 04, 2022 3:10 am ]
Post subject:  Re: Can a python script use gimpfu, run from terminal, and create new

The script bit need to be run from Gimp. Gimp isn't designed to be an image processing library, but to be a GUI image editor. So your Python script would have to explicitly start Gimp, and give it the script to run, and possibly a source directory, see here(just repalce .BAT/sheel by Python).

Another solution is to write a Gimp script/plugin, and start it from inside Gimp.

But IMHO if you are in Python, there are plenty of image libraries that can do this, such as Pillow. You can also use ImageMagick, either by calling as a command or using its python bindings. Using Gimp for this is really one of the most complicated ways I can imagine.

Author:  ransa202 [ Sat Feb 05, 2022 2:00 pm ]
Post subject:  Re: Can a python script use gimpfu, run from terminal, and create new

I see, thanks for the pillow suggestion im reading about it more now.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/