Gimptalk - Premier Gimp Community: Script to place overlays on images - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Script to place overlays on images

#1 User is offline   scrontch 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 13-September 07

Posted 21 October 2012 - 08:44 PM

Hi,

i need a script to perform the following task:
Load a PNG image.
Load another (smaller) PNG image and place it as an overlay on the first one (it has transparent parts).
Then save the whole as a new PNG image.

This has to be done for a lot of images.
The first images are all of same size (32x32),
the second ones are smaller.

The position where to place the overlay is not always the same, so i plan that the info about which image to use and where to place the overlay could be provided in a csv file like:
backgroundimage-name, overlay-image-name, position-x, position-y

The script should go through the list and perform the task fully automated. This should be done from a command line if possible, so that the script itself can be part of scripted build process.

Does anyone have a similar script or can help develop it?

If not, how do i start quickly?
I am familiar with Python, (not with Script-Fu Lisp).
I am completely new to GIMP scripting however.
I read the "Python and Gimp" sticky section, but it seems outdated.

regards,
Scrontch
0

#2 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 360
  • Joined: 01-June 05
  • LocationUK

Posted 22 October 2012 - 04:09 PM

It would be perfectly possible to write a suitable script in Python.

The GIMP Python documentation isn't a bad place to start to learn GIMP scripting: http://www.gimp.org/...thon/index.html and GimpChat has a list of scripting resources: http://gimpchat.com/...c.php?f=9&t=724

Although it must be said that your comment about running from the command line tends to suggest that ImageMagick might be your best solution. http://www.imagemagi...cript/index.php

Kevin
Kevin
0

#3 User is offline   scrontch 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 13-September 07

Posted 22 October 2012 - 08:06 PM

Hi paynekk,
thanks for the suggestion.
But i figured out it will probably be easier to go directly with the Python Image Library.
Then i won't need any external program (including Gimp).
0

#4 User is online   ofnuts 

  • Moderator GT
  • Group: Moderators
  • Posts: 1,236
  • Joined: 17-October 10
  • LocationLooking over your shoulder :)

Posted 23 October 2012 - 07:27 AM

View Postscrontch, on 22 October 2012 - 08:06 PM, said:

Hi paynekk,
thanks for the suggestion.
But i figured out it will probably be easier to go directly with the Python Image Library.
Then i won't need any external program (including Gimp).
But figuring out the right parms for IM is likely to be faster (and will run faster too). The ImageMagick forum has plenty of helpful people.
010011110110011001101110011101010111010001110011
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic