Hello, I’m new to gimp and I need to crop out multiple 1600x256 px parts out of a 4160x1968 px image.
So far I’ve managed to fix the crop box size in the Tool Options, but now the problem is that I have to export the cropped part manually and it’s very inefficient.
Is there any way to do this operation in bulk? for example I select multiple crop boxes and export all of them at once.
Note that the crops are not aligned, and I need to freely choose them.
Instead of cropping you can copy/paste them to new layers (Ctrl-C, Ctrl-Shift-N) (the rectangle select tool has the same “fixed” option) and then use a script to export all layers (many available, including my own ofn-export-layers.
Alternate method:
Make sure there is an alpha channel (Layer > Transparency > Add alpha channel)
Make your multi-rectangle selection
Select > Invert and Edit > Clear (or Ctrl-I + Del) so that your rectangles are now surrounded by transparency
But even though I placed the ofn-export-layers-cumulative.py in ~/.config/GIMP/2.10/plug-ins and restarted the GIMP, I still don’t have the File ➤ Export layers accumulations.
Figured it’s because the python support is not working in my Gimp. I don’t have Filters > Python-fu menu, but Python 3.10.12 is installed on my system.
Gimp python support requires Python 2.7.x, which is unfortunately deprecated and is dropped by many distros as a defaults install, while the distro’s Gimp version is made Python-less.
There are several ways to reinstate it.
I believe this PPA lets you install Gimp 2.10 with Python support. Python 2.7 is still available in the repos AFAIK.
There are also an official flatpak version with a built-in Python, as well as several AppImage. But you have to live with the implied sandboxing.
There’s no problem with installing multiple versions of python. I installed python 2.7 by sudo apt install python2.7 and the python support is not still working.