Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scripting GIMP on a basic level as a newbie
#1
Brick 
Hi everyone,

I have downloaded GIMP, and know nothing about it yet, except it supports scripting. Can anybody tell me if it can be used as a tool for my specific purpose?

I am thinking about developing software. Users of this, can load photo's, each of which are (optionally scaled) placed somewhere in the result, which will be a photo collage. To figure out if such software is of any use, and to test in practice how it would "feel", I was thinking about setting up an experimental quick&dirty test set-up. 

I will run my own program, written in C, having its own UIF to let the user define the photo collage. It generates a GIMP script file. I just read this should be in Scheme/Script-Fu, which I figure will be in ASCII format? After this, GIMP should load the script and execute it, to see the final result. If all this is possible, it wil be very unworkable, however my goal is to setup a quick&dirty environment, only to orientate myself about developing software for the photo collage. 

I only need three script commands: load photo (name), scale it (width, length) and place it (x, y). These will be repeated for each photo. (after learning GIMP, maybe GIMP can do the full job all on its own without my external C code?)

My two questions:

- Do these three script commands exsist? (I also might need "new": erase all previous content)
- How to load the script file in GIMP and run it?

very many thanks for any feedback!
Smile Undecided
Reply
#2
Not wanting to rain or your parade, but there are already hundreds of such applications. And who still write UIs in C these days?

Using ImageMagick's compose utility is likely easier than using Gimp for this.

Gimp can also be scripted in Python, which is going to be a lot easier to grasp if you have a C background. You can even use Python to code a UI extension for a plugin.

Script-fu or Python, yes, you can load/scale/position images in Gimp. Plenty of Python plug-in exemples here. Running things in batch mode is a bit different, see here.
Reply
#3
(09-23-2019, 11:29 PM)Ofnuts Wrote: Not wanting to rain or your parade, but there are already hundreds of such applications. And who still write UIs in C these days?

Using ImageMagick's compose utility is likely easier than using Gimp for this.

Gimp can also be scripted in Python, which is going to be a lot easier to grasp if you have a C background. You can even use Python to code a UI extension for a plugin.

Script-fu or Python, yes, you can load/scale/position images in Gimp. Plenty of Python plug-in exemples here. Running things in batch mode is a bit different, see here.

Thanks Ofnuts,

Looking into ImageMagick now. Looks like I don't have to wrestle documentation, since it looks like to support simple command line usage. Can I come back to you / Gimp if it DOES have issues? I ran into TREMENDOUS python scripting issues using Blender, a free 3D modeling tool, which I resolved by letting Blender ONLY do the 3D display, after doing ALL the modeling by my own external C code.  

rgds
Reply
#4
Always glad to help...
Reply


Forum Jump: