Is it possible to execute script when pixels have changed, knowing the change bounding rect?

There’s a tool that I’d really like to have, and AFAIK it does not exist at all. When drawing textures freehand one typically wants them to be seamless. How I’d go about that is having larger image than the texture being drawn. Let the texture be a square in the middle of it. If any pixels change before the left edge of the texture, mirror that change to the before the right side inside the texture. Same from the other overlaps. That way, you can draw something at the edge and the opposing edge will be affected.

Is it possible to intercept the drawing with python and do these changes? I think hooking up to the event where GIMP creates a undo step would be best place. But it is important I know the boundiung rect that has changed - if the user draws a line accross the entire image, the result is undefined.

I thought gmic could make a texture tilable. I don’t quite remember, @afre or @Reptorian ?

@MXXIV Welcome to the forum! The first thing I would suggest is to show what you mean instead of using words alone. Also, an example image you are working on would be nice.

Are you looking for something like the wraparound mode in krita?

Maybe something like the Inkscape seamless tile template where you paint in the tile and get a 3x3 preview of what it looks like as you are drawing.

In Gimp using symmetry painting, a template but the reverse, painting in a 3x3 grid and by selection, obtain the tile.

A bit quick but as an example a 1200x1200 canvas and symmetry tiles set to 400

Could this be scripted in python, I do not know.

1 Like

:+1:That’s really a nice solution.

Same question here and it has been accepted?

Otherwise, no, the API of plugins assume that the plugin executes and exits.

What you are trying to do is re-inventing the symmetry painting… that doesn’t even use a call back, it merely extends the paint operations.