I am working with a sprite sheet, and I want to generate individual images for each frame, hopefully using some convenient naming convention.
I've set the image grid so that each individual frame is in a rectangle of the grid, and I was hoping that GIMP could automatically generate a list of files using this spacing and offset, naming the images after the row and column they're in. If I had the file list, however, it would be trivial to have them named properly using a simple script, therefore the naming of the files would just be a convenient addition.
I'm currently manually cutting each frame using the crop tool, then exporting it as a PNG, reloading the sheet file and repeating. Since I'll be doing this with a large number of sprites, each with a far more frames than I'm currently working with, this method will soon become unsustainable.
The "py-slice" plug-in that ships with GIMP have a similar functionality, although it relies on image guides - https://gitlab.gnome.org/GNOME/gimp/blob/master/plug-ins/pygimp/plug-ins/py-slice.py
It should be relatively easy to change that script to work with fixed-sized rectangles and internal padding instead of creating its rectangles from manual positioned guides.
In special you won't need almost any of the code in the for
loops that interact on horizontal and vertical guides, on lines 90-127 , there, and also, none of the HTML generating stuff -
Instead, add the "sprite width, height, internal paddings" as inputs, and iterate the rectangles - and change some parameters in the "register" call so that your file register itself as another plug-in, instead of the existing one.