It is currently Mon May 20, 2013 12:19 am


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: GimpPreview API in Python ?
PostPosted: Thu Jul 05, 2012 11:56 am  (#1) 
Offline
GimpChat Member

Joined: Jan 13, 2011
Posts: 520
Location: Poland
http://registry.gimp.org/node/26562
John writes:
Is there a way to utilize GimpPreview (or live preview window) api in a Python plugin? I can't find any tutorials or plugins using it and most resources are several years old.

This is not a solution - but maybe some direction.
Probably the only plugin (py) displays the image in your window is: GimpPublishr by Jayesh Salvi.
http://code.google.com/p/altcanvas/wiki/GimpPublishr

I'm not a programmer- can anyone look at the code?

The Annex - Image_in_python.py ( fragment of plugin GimpPublishr ).
In Gimp menu: File - > Image in plugin python
It does not do anything - just displays the image (without scaling and not every type of file).

Does anyone have an idea how to add (in gdkpixbuf.py) proper behavior scale ?

Can it be useful for something beyond the additional preview ?


Attachments:
Publishr-gimp.png
Publishr-gimp.png [ 176.53 KiB | Viewed 924 times ]
Only preview.png
Only preview.png [ 236.99 KiB | Viewed 924 times ]
Image_in_Python.zip [3.22 KiB]
Downloaded 75 times
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 

 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 12:42 pm  (#2) 
Offline
GimpChat Member

Joined: Jan 13, 2011
Posts: 520
Location: Poland
I saw an idea garagecoder:
http://www.flickr.com/groups/gmic/discuss/72157632674501653/
Question for GC:
wxwidgets can be used as a preview for each file Python?
Can I ask for more information (for beginners on this issue)?


Attachments:
GC-tool.png
GC-tool.png [ 90.09 KiB | Viewed 270 times ]
Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 3:54 pm  (#3) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 80
Hi MareroQ
I'm not sure if I understand your question correctly, but I think you're asking if it's possible to have a preview window in a gimp python plugin. I think it's always been possible using a C wrapper, but according to this thread it should be possible directly from python now:

http://forum.meetthegimp.org/index.php?topic=87.0

I'm afraid it's not something I know a lot about, you could definitely write a C wrapper to do it but that's not something I'll be working on for now. If anything GTK will be what you need (not wxwidgets) to interface with.

*edit* there are some things I'm working on, documentation of gmic with wxwidgets and possibly a python wrapper for gmic (which I have already tested at a basic level). But don't hold your breath waiting!


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 4:27 pm  (#4) 
Offline
GimpChat Member

Joined: Jan 13, 2011
Posts: 520
Location: Poland
This could be your revolution for Gimp Python.
(Unfortunately, my options are limited by the lack of a good knowledge of the English language).
Can you put the code somewhere (and instructions) on how you obtain GCTool


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 4:34 pm  (#5) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 80
Hah I knew it would be dangerous to show it so early :)
I made it as a quick and dirty test of gmiclib with wxwidgets. The code is ugly. I'm not even a c++ programmer. But... once I have it to a reasonable state the code will be released, along with docs on the gmic wiki (which is the main reason for creating it).

Anyway back to your python question now that you got me interested, I had a look at the python script and I see "import gtk.gdk" and "import gtk" so basically the plugin is creating it's own GUI using a gtk python module. Beyond that I can't help without spending a lot of time learning python... hmm I'm so easily distracted :roll:


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 4:40 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jul 14, 2010
Posts: 500
garagecoder wrote:
... according to this thread it should be possible directly from python now:
http://forum.meetthegimp.org/index.php?topic=87.0


I've tried a number of times to get this working with no success. Possibly a more experienced python coder might have better luck than I.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 4:51 pm  (#7) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 80
Does somebody have a link to a recent version of "gimpui" python module? Perhaps just looking at the defs/classes in that would shed some light. Anyway I'm out of my depth here so I'll leave it to some flyby expert (I hope!).


Top
 Profile  
 

 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 5:28 pm  (#8) 
Offline
GimpChat Member

Joined: Jan 13, 2011
Posts: 520
Location: Poland
For a beginner is not consolation
experienced programmer (Rob'A) has the same problem - with an image in Python for GIMP plugin - a much-needed solution - any idea on weight in gold


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Tue Feb 05, 2013 5:49 pm  (#9) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 80
OK well if it is something a few people want, I'll look into it tomorrow. If it starts taking me days I won't be doing it though, so no promises!


Top
 Profile  
 
 Post subject: Re: GimpPreview API in Python ?
PostPosted: Wed Feb 06, 2013 4:26 am  (#10) 
Offline
GimpChat Member

Joined: Jan 13, 2011
Posts: 520
Location: Poland
"Tomorrow Never Dies".
Apparently, time is money –when ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login   * Subscribe to RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group