Development of a GIMP plugin on MacOS

So I have the need for a plugin for Gimp. I want to try my hand at development of said Plugin.

Programming wise I am probably most fluent in C. Not sure if this is the best route but documents on the Python interface are hard to come by and I am not well versed.

So from what I understand is that to get the proper libraries in Mac I would need to build Gimp myself. What would be the best approach as documents here seem non existent. Would Macports be the best method like other software?

Wish there was more documents on this because I can’t seem to find much info.

Hi @blj,

If you “just” have to make a plug-in for The Gimp,
you do not have to build The Gimp yourself.
Use duckduckgo and search for gimp scripting.

Have fun!
Claes in Lund, Sweden

The best place to get help is the gimp IRC channel. There you can find the developers.

Seems like to do a plugin with C I would need the dev files for libgimp which requires a build on macOS. From what I understand is I can just install through Macports and it should get everything I need but I would have to figure out where the headers are. I could just script it with script-fu or something but then I lose the ability to see a preview python might be a option to have a preview as well but I am not sure if I need a actual python install or not to do that.

Not sure if probing IRC is the best course of action as the documentation seems to say not to bug devs with plugin questions unless really hard. This is more a annoyance trying to figure it out then really hard.

MacOS Developer are really needed and the Gimp developers are helpful.

Could you please point me to the documentation. That sounds stupid, or what do you think @jehan.

Headers are in $PREFIX/include/gimp-2-0/libgimp*/*. Library flags/paths are available through pkg-config like any other library (I hope you have pkg-config in macOS).
With GIMP, we also install a tool named gimptool-2.10 (look the --help output, it’s a pretty straightforward tool) to help compiling GIMP plug-ins.

Which documentation says this? IRC is our go-to discussion channel and the best place to go to ask for plug-in development help IMO.

Of course, we prefer reasonable people and can’t answer every minor question every 5 minutes of every day (like anyone, it’s not GIMP devs-specific! :stuck_out_tongue:), but other than this, people on the IRC channel are happy to help other people when they ask us nicely and are patient. :wink:

Plug-in documentation? Last I remember, there are some on gimp.org, but it’s terrible. One of the thing I really want to do before GIMP 3 release is to write proper docs for plug-ins. Most of the things I know from plug-in developments (whether for C, Python or anything else) is by looking at other people’s plug-ins, trying out random things (or looking at GIMP code itself of course)…

No questions are ever stupid (or else I am very very stupid myself as I ask a lot too!). :slightly_smiling_face:

https://wiki.gimp.org/wiki/Hacking:Plugins
under the section Community of Gimp Plug-in Authors

I could however simply be misinterpreting the phrasing if it is trying to say something else I think the wording is way off.

I am still in the process of actually trying to build Gimp and I honestly believe macOS does not have pkg-config. At least by default this is why all these package managers are recommended but they really mess up the system imho. I have been trying to build using Gtk-OSX. Hit a few hiccups going to try again today now that I understand better how JHBuild works.

Still a challenge though because I am trying to figure out how to do this without all the CircleCI stuff that the docs point to for building on Mac. I think somewhere in the future it would be interesting to see some sort of plugin sdk for us Mac and Windows peoples. Since switching to Mac after catastrophic hardware failure I really miss having a good package manager :smile:

If you mean this part:

Questions to GIMP developers concerning C-language plug-ins are discouraged for all but difficult questions.

It just says what I said above, i.e. we can’t obviously answer all beginner questions (we are not human tutorials!) or we’d have no time to do anything else. :wink:

Yet when you have complicated stuff and you can’t find any answer on the web or otherwise after hours of searches, we happily answer (if/when we can).

If you mean:

Bugs in third-party plug-ins (those not distributed with GIMP) should NOT be reported as GIMP bugs, only reported to the author or maintainers of the third-party plug-ins.

It just means a bug in the code of a plug-in is not a bug in GIMP. Don’t tell us that your favorite plug-in is crashing (unless it is determined after some investigation that this is because of a bug in GIMP). Same as you don’t report bugs to Apple when your favorite software in macOS crashes (unless said software is developed by Apple of course). :wink:

We have enough of our own bugs in GIMP as it is to not have to also fix other people’s bugs.

Still a challenge though because I am trying to figure out how to do this without all the CircleCI stuff that the docs point to for building on Mac.

The CircleCI stuff is for automatic building on the platform of this service. It doesn’t mean you have to use CircleCI. Though I guess the script contents itself is the useful part for you to figure out how things work.

I think somewhere in the future it would be interesting to see some sort of plugin sdk for us Mac and Windows peoples.

Patches accepted! :smiley:

Yes I meant that part. Thanks for clarifying the statement. It makes sense that the devs can’t answer the basic stuffs which is never to be expected imho.

Yes it is quite confusing trying to figure out what is needed. As far as I can tell from looking into it I think I can just get by using the Gtk-OSX gimp fork and use the jhbuild-custom from the Automated system to make sure I get the right modulesets which I think will take care of the patching. Will find out and take notes through my trial and error process and maybe I can write something up if I am successful. :smile:

:smile: I think it is more or less just finding a way to easily bundle the necessary C libs and headers for C Plugin development similar to how on Linux you can just download the libgimp-dev package. gimptool seems to already be included in the standard macOS release it is just the development libraries and headers that are missing. Not sure how difficult it would be to isolate said things for easy isolated deployment to those who are crazy enough to want to write a C plugin on Mac or Windows.

Either way thanks for stopping by with some input. I will keep mucking about when I have time trying to get what I probably don’t even need. I am also going to investigate just automating the process with script-fu without a preview as well. I am only trying to automate a sharpening process that I use to do in photoshop and wanted a “preview” of the results to save some trial and error. This preview might not even be possible in gimp as of yet no clue. Very new to gimp and what it is capable of.

Any progress? Did you manage to locate the includes? I’d prefer not to pull the whole GIMP/libs sources just to get the “libgimp-dev” stuff on mac

No never did figure it out. I don’t have a Mac computer anymore to test. Ironically just recently I switched to a pure iPad workflow as my PC went to a family member who desperately needed one. Loving the workflow so far.

I see. I found this one:

but it also tries to download tons of stuff I generally don’t want to have installed. I think I’ll just compile the plugins I need to compile under GNU/Linux and run them there.