Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie : need help to do a mosaic from tiles
#5
(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)
PS: after a long career in programming, I can assure you that most of the time you find that the problem is with your code(*). I have started many bug reports that eventually ended in the bit bucket because while make sure that my case was watertight I found the problem in my ways.
(*) 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).
Reply


Messages In This Thread
RE: Newbie : need help to do a mosaic from tiles - by Ofnuts - 04-10-2021, 04:51 PM

Forum Jump: