Gimp 2.10 'with files' batch - 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: Gimp 2.10 'with files' batch (/Thread-Gimp-2-10-with-files-batch) |
Gimp 2.10 'with files' batch - rich2005 - 11-15-2018 As you know, I am not a coder. Selina in this post https://www.gimp-forum.net/Thread-Changing-resolution-DPI?pid=11445#pid11445 has an unknown number of .xcf files of various ppi and would like all as 96 ppi. A little plugin to do one at a time: Does not do much, sets the ppi and saves the image straight away. Code: #!/usr/bin/python Can this be used in a Gimp batch mode? https://wiki.gimp.org/wiki/Release:2.10_changelog has a with-files macro. Seems simple but I can not get this to work. Not using the flatpak, using a 'bunt' 18.10 VM & Gimp 2.10.6 Quote:-A new 'with-files' macro is available to run commands on several files at once. For instance, if you want to invert colors of all png files in a directory, and save them as jpg, you could run: **quiet rant** Gimp really needs some sort of macro facility that does not rely on command line or writing a script. Tried all ways with BIMP but it just does not handle .xcf files with several layers. RE: Gimp 2.10 'with files' batch - Ofnuts - 11-15-2018 You don't need "with_files" in Python since you have something like this already in the language: Code: import glob You stuff this a plugin that takes a single argument that you declare as a PF_DIRNAME in the registration. The user starts the script from a Gimp menu; enters the directory, and there you go. Coded "from the hip", so some mistakes/oversight possible. You can make that a shell batch but it's a bit more complicated. |