(03-25-2025, 12:20 PM)Ofnuts Wrote: However, if I guess correctly what your code does, it is simpler to just duplicate the source layer and then crop it around the tile with a layer_copy.resize(). See my ofn3-layer-tiles script.
That's exactly what i'm doing at lines 88, 89
Code:
object_layer = layer_copy.copy()
x1, y1, x2, y2 = layer_copy.mask_bounds
and line 121
Code:
object_layer.resize(x2 - x1, y2 - y1, -x1, -y1)
https://developer.gimp.org/api/2.0/libgi...l#GimpTile
My problem is not being able to use GimpTiles to quickly loop over pixels, my guestimation is that if i loop over pixels via drawable.get_pixel() directly in stead of looping over gimptiles and than looping over the pixels of the gimptiles the code would run 10x slower. I made this code a while ago circa 2018 and what i remember back then was that if I didnt use GimpTiles, if i can recall 25 or 30 seconds for a heavy sprite sheet versus 2 to 4 seconds when using GimpTiles.