What you want to do is quite simple and is a good project to start scripting.
I haven't not seen any good tutorials on Python scripting yet...
There is a (slightly incomplete) doc here: https://www.gimp.org/docs/python/index.html . This coupled with the reading of existing code will get you started.
Speaking of existing code, I have written a few Python Gimp scripts over time, see here: http://sourceforge.net/projects/gimp-too...s/scripts/ My style evolved over time, the more recent scripts are likely better examples, but can also be a bit more complex. Feel free to borrow/steal code or ideas. The one closest to what you want to do is perhaps ofn-rotate-layer, it shows you how to copy the source layer and do some editing (in that case it rotates it). It also shows you how you feed parameters to a script.
To debug you scripts, some hints here: https://www.gimp-forum.net/Thread-Debugg...in-Windows
Don't hesitate to ask more questions...
I haven't not seen any good tutorials on Python scripting yet...
There is a (slightly incomplete) doc here: https://www.gimp.org/docs/python/index.html . This coupled with the reading of existing code will get you started.
Speaking of existing code, I have written a few Python Gimp scripts over time, see here: http://sourceforge.net/projects/gimp-too...s/scripts/ My style evolved over time, the more recent scripts are likely better examples, but can also be a bit more complex. Feel free to borrow/steal code or ideas. The one closest to what you want to do is perhaps ofn-rotate-layer, it shows you how to copy the source layer and do some editing (in that case it rotates it). It also shows you how you feed parameters to a script.
To debug you scripts, some hints here: https://www.gimp-forum.net/Thread-Debugg...in-Windows
Don't hesitate to ask more questions...