(04-10-2021, 02:32 PM)franco1000 Wrote: Hello ,
I moved layer A partially over the Layer B: They are superimposed so I must crop a slice of A ( or B). I tryed to make a python script using the method " pdb.gimp_layer_resize".
But i had only bizzare results not corresponding to the instruction of the Python console help.
A bug exists, i don't know if in the procedure or in me.
Some suggestions?
Thank you,
Franco
When layers overlap you don't need to do anything if they are fully opaque, as long as they are in the right order in the stack.
Otherwise pdb.gimp_layer_resize() (or more simply layer.resize()) works OK, but the way it is defined (old-new), if you want to select an area inside the layer the offsets to provide are negative. For instance, to get the green area from the red area, you use:
Code:
layer.resize(100,200,-150,-50)
(*) when it's your code v.s. a generally available piece of code: compiler, API... When it's your code v.s. a coworker's code, it's a more of a gamble of who will eventually pay the "hop tax" at a nearby bar (I don't lose often these days).