It is currently Tue Jul 02, 2024 1:40 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 2:34 am  (#1) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
Hello
I have created a new image with : pdb.plug_in_gmic_qt
This creates an image with an automatic display
When I check the id of this new image with : pdb.gimp_message(gimp.image_list()) I have got : <gimp.Image '[Sans titre]'> (which is referenced as gimp.image_list()[0] )

When I want to close the image, of course I need at first to close the display.
But I don't find a way to save my previous display !

I have tried
saved_display_id=gimp.Display(gimp.image_list()[0] ) -> script doesn't run

Thanks for the help !


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: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 3:17 am  (#2) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7744
Location: On the other side of this screen
Have you tried exporting it?

_________________


Top
 Post subject: Re: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 6:27 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12707
Location: Spain, Aragón
Fransua, I hope this explanation can help you.


Attachments:
To save an image.pdf [277.03 KiB]
Downloaded 82 times

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 8:52 am  (#4) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
Issabella wrote:
Fransua, I hope this explanation can help you.


Thanks Issabella I have use your trick. Create a new layer and export it.

But still there is something mysterious about manipulating display id ...


Top
 Post subject: Re: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 10:09 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
I used this in one of my scripts:
        for displayID in range(1,image.ID+50):
            display=gimp._id2display(displayID)
            if isinstance(display,gimp.Display):
                #print 'Image: %d; display %d' % (image.ID,displayID)
                break
        if not display:
            raise Exception('Display not found')           
        gimp.delete(display)

However, there is no way to make sure that the display you found really belongs to the image (even if starting at image.ID instead of 0 covers your *ss as long as there is only one display for each image opened before the one you are working with).

_________________
Image


Top
 Post subject: Re: How to get the Display from a new image created with Gmic ?
PostPosted: Tue Feb 16, 2021 10:26 am  (#6) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
ofnuts wrote:
I used this in one of my scripts:
        for displayID in range(1,image.ID+50):
            display=gimp._id2display(displayID)
            if isinstance(display,gimp.Display):
                #print 'Image: %d; display %d' % (image.ID,displayID)
                break
        if not display:
            raise Exception('Display not found')           
        gimp.delete(display)

However, there is no way to make sure that the display you found really belongs to the image (even if starting at image.ID instead of 0 covers your *ss as long as there is only one display for each image opened before the one you are working with).


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Add letter X to certain pixels with image I created in Gimp

7

No new posts gmic cli with -output spits out an empty image

2

No new posts Corrupted display on custom platform

3

No new posts Attachment(s) Create a Shape Cluster Photo Display plugin

5

No new posts Can't get marching ants to show (selection boundary display)

2



* Login  



Powered by phpBB3 © phpBB Group