You are here

Pulling TX from File & Merging w/images on Layers

Hello! I am looking for help automating GIMP. We are a non-profit looking to expand our messaging but need help automating our process.

In short: I have a template with 5 Layers reserved for unique content ( I call these dynamic layers). After I populate the layers with images and text I export the image in jpeg for use on the web. Imagine a brochure with the 5 content boxes, each box in my case is a layer (there are additional layers in the image with static content). I change the content boxes to create the various "brochures". 2 layers are images, and 2 are text, the fifth is also an image.

What I would like to do is automate the process because I am in need of a lot of content for messaging purposes that is tailored for particular audience(s).

Some consideration:

1.) Using a text file called left_text.txt, I create messages, one message per line. There will be multiple lines of text. Text Left Layer
2.) Using a text file called right_text.txt, I create messages, one message per line. There will be multiple lines of text. Text Right Layer
3.) In a particular folder: place images to be used in one of the layers called left image.
4.) In a particular folder: place images to be used in one of the layers called right image.
5.) Image Banner - a folder with images used as banner images: place images to be used in the banner layer.
6.) always center images
7.) always us the formatting of the text layers

My though then is to automate the process as follows:

Start a script to:
1.) Pull the first line of text from the left_text.txt file and place it in the corresponding left text layer
2.) Pull the first line of text from the right_text.txt file and place it in the corresponding right text layer
3.) pull a random image from the right image folder and place it into the right image layer
4.) pull a random image from the right image folder and place it into the left image layer
5.) pull a banner image and place it in the banner layer
5.) save the file in xcf format
6.) clear the layers in a designated folder (can be a fixed folder!)
7.) Still using the first line of text in the left_text.txt file Iterate through each line of text in the right_text.txt file until all lines have been processed.
8.) move to the second line of text in the left_text.txt file and repeat the process of placing the text in the formatted text boxes and image boxes for all text lines in the text_right.txt file.

** Special Note: At times there will be no lines of text in the text_right.txt file. In which case skip the placing of text right text but do continue to process image files in image_right layer, image_left layer and banner_layer.

** Special Note: There will generally be more image files then text strings and that is why I am asking that random images be selected. If I change the message and we always start with the first image then the first images would be selected most often...

Once this is complete I should have a wide array of images including all the text information against random images which I can then review and adjust. I will scale images, move text...to perfect the final images but the bulk work of inserting the text and images into created images will be accomplished by the script.

for reference (if you are interested) http://sheltertheworld.org

Can anyone help?

Thanks, Rich

AttachmentSize
Gimp Capture.JPG88.32 KB

Hi Everyone, I see my original post was read 23 times but there are no comments? Is this because what I am asking is NOT possible? Any Help is appreciated...If pointing me in the right direction!! Thanks so much. Rich

This has been addressed in the GIMPchat.com forums.

http://gimpchat.com/viewtopic.php?f=9&t=10101#p132782

Subscribe to Comments for "Pulling TX from File & Merging w/images on Layers"