It is currently Mon Aug 10, 2026 9:11 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Salutations, friends.
PostPosted: Sat Sep 08, 2018 12:39 pm  (#1) 
Offline
New Member

Joined: Sep 08, 2018
Posts: 4
Hey, all.

My background is in software development and I'm dabbling with GIMP relative to a current project.

Specifically, using Python to do image processing. Since I'm just starting to learn, I'm usually trying to rudimentary tasks like changing the color of a black square.

Like a lot of mature open source projects, there have been many efforts to document, communities, etc. over the life of this project. So it's easy to stumble onto dead links, abandoned forums, outdated answers.

To cite an example: it took hours figure out how, using the Python-Fu Console, to get simple commands to run on my image for testing. e.g.:
from gimpfu import *
image = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)

In all fairness, it is a well-established matter of public record that there are few with in my league when it comes to dim-witted clodding about -- yet I can't help but suspect that there are some good educational resources out there that I've overlooked.

Anyone have suggestions?

[EDIT: Found the sticky viewtopic.php?f=9&t=724 in the Scripting board but other thoughts are still invited.]

Many thanks!


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: Salutations, friends.
PostPosted: Sat Sep 08, 2018 2:46 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Oct 12, 2016
Posts: 377
Image

_________________
Image


Top
 Post subject: Re: Salutations, friends.
PostPosted: Sat Sep 08, 2018 4:37 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4527
Location: Canada
you don't need the from gimpfu import * line if you're running in Python Console.
it's only needed in .py scripts that you'll write.

and you see more pdb.* function calls, inside GIMP just go to Help->Procedural Browser
and type some words to search for whatever procedure then you're able to use that same name (just replace all the - (hyphens) with understcores (_) and add pdb. in front of it.

to start writing your own script take any existing .py script and gut everything that's usually in the first function, and then other functions just register it to the procedure database.
then you have empty (shell) and you can add your own code.
Here's an example (shell) that has no gut code, you can add your own add gut code to and change the function names and register it to where you like on the Menu
https://gimplearn.net/viewtopic.php?p=119
The above sampe shell template just registers itself and outputs a message inside the core code, it has access the image, and layer which are passed in from the GIMP's front end so you don't have to use image_list()[0] it's just image, and layer is the currently chosen/active layer.
have fun.

_________________
TinT


Top
 Post subject: Re: Salutations, friends.
PostPosted: Sat Sep 08, 2018 10:47 pm  (#4) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 8454
Location: On the other side of your screen
Welcome to Gimp Chat :)

_________________
Image
Free Fun Photo Editing & resources
Poems from the Lord
Gimp Newby
Gimp version 3.2.4 and GMIC-Qt 4.0.2 OS :- Windows 10 Home 64


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group