It is currently Tue Aug 25, 2026 1:21 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: circle of pictures
PostPosted: Sun Dec 03, 2017 10:19 am  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Hallo,
I got a question on a German forum:

If you arrange pictures in a circle partially over the other the last one is
over the first and over the last but one picture:
To get it OK one can use "alpha to selection" and Ctrl-X on the (correct) layer.

My question is now: what are the Python commands to be able to automate this action I tried something like this
pdb.gimp_image_set_active_layer(img, img.layers[-2])
pdb.gimp_image_select_item(img, 1, img.layers[0])

layer -1 is the background layer -2 the first picture and naturally layer 0 is the last
one overlapping TWO picture, but it should do so only with ONE.

What Python command(s) could be used in place of Ctrl-X ???
Attachment:
File comment: one picture not OK
ueberlappen_1t.png
ueberlappen_1t.png [ 183.03 KiB | Viewed 3763 times ]

The upper grey Mandela-picture should be over the left one picture.

Creating from two (or more) pictures a Ring like this is done in the Python console.
Only the two commands, possible in the Gimp-window "alpha to selection" and what Ctrl-X (on the right layer) would solve my problem ;)

Your wisdom for me would make (grandfather) Peter happy


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: circle of pictures
PostPosted: Sun Dec 03, 2017 1:15 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
let me think more about it but I would completely avoid the problem bu doing it differently. If I need to arrange 8 pictures in a circle: 1..8 then I create a 9th picture which is a copy of the first with one half made transparent:

Attachment:
Overlaps.png
Overlaps.png [ 18.68 KiB | Viewed 3739 times ]


See attached XCF.


Attachments:
Overlaps.xcf [57.29 KiB]
Downloaded 123 times

_________________
Image
Top
 Post subject: Re: circle of pictures
PostPosted: Sun Dec 03, 2017 1:16 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Otherwise I think you need pdb.gimp_edit_clear() (which is more like [delete] but this should be enough)

_________________
Image


Top
 Post subject: Re: circle of pictures
PostPosted: Mon Dec 04, 2017 12:04 pm  (#4) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
ofnuts wrote:
Otherwise I think you need pdb.gimp_edit_clear() (which is more like [delete] but this should be enough)


Your idea onuts of using a half of a suitable picture works nicely. Thanks ;)

the gimp_edit_clear() , as a replacement for ctrl-x after an "alpha to selection"
seems not to be the real needed analogon. Or I do not do it yet correctly.

Peter


Top
 Post subject: Re: circle of pictures
PostPosted: Mon Dec 04, 2017 3:16 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
PKHG wrote:
the gimp_edit_clear() , as a replacement for ctrl-x after an "alpha to selection"
seems not to be the real needed analogon. Or I do not do it yet correctly.


Possibly... because I have used it and that works as expected: the selection is made transparent on the target layer (in you script, I assume that you create a selection using one mayer, and gimp-edit-clear() the other layer...

_________________
Image


Top
 Post subject: Re: circle of pictures
PostPosted: Tue Dec 05, 2017 5:55 am  (#6) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
OH , it is so easy, if one knows:
Problem Solved, by using pdb.gimp_edit_cut(onasuitableLayer)
That is like a ctrl-x (with the good selection!)
onasuitableLayer is eg. image.layers[0] (at my script).

Thanks Ofnuts, for your reply above.
Will have a look at it ;-)

Greets
Peter


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


cron

* Login  



Powered by phpBB3 © phpBB Group