Post has attachment
animate still images as .gif using IWarping Gimp

Lastest, and certainly last version of my card generator script :

********************************************************

# python_fu_cardgen -- Generate images from a template by filling layers from a text file infos (text layers are filled with text, others are filled with image). Genere des images a partir d'un modele en remplissant les calques depuis les informations d'un fichier text (les calques texte sont remplis avec du texte, les autres avec des images). A Gimp-Python plugin.
# Copyleft Koin-Koin 2017
# Version 0.4
# - add image management
# Version 0.3
# - replace deprecated commands
# Version 0.2
# - detect data file separator from : coma (,), semi-column (;) and tabulation (\t)
# Version 0.1
# - script-fu to python conversion of the core function
#
# Usage :
# - create a XCF file with image layers (template)
# - create a text file with headers matching layers name (data)
# - create a folder containing images to insert
# - launch the plug-in
# - choose data file, template, images source folder and output path
# - for each line, a jpeg file will be created in the output folder
# - first column entry will be used for jpeg naming
#

from gimpfu import *
import csv

def generate_card(pCSV_File, pCard_Template, pImages_Path, pOutput_Path) :
file = open(pCSV_File, "rb")
dialect = csv.Sniffer().sniff(file.read(), delimiters=';,\t')
file.seek(0)
reader = csv.DictReader(file, dialect=dialect)
headers = reader.fieldnames
for row in reader :
image = pdb.gimp_xcf_load(0, pCard_Template, pCard_Template)
title = row[headers[0]] #save first data for naming output file
layers = image.layers
for header in headers :
for layer in layers :
if header == pdb.gimp_item_get_name(layer) : #only act on text matching current header
if pdb.gimp_drawable_is_text_layer(layer) : #only act on text layer
pdb.gimp_text_layer_set_text(layer, row[header]) #set text from file
else : #act if non text layer
filename = pImages_Path + "//" + row[header]
temp_layer = pdb.gimp_file_load_layer(image, filename)
pdb.gimp_image_insert_layer(image, temp_layer, None, 0)
real_name = pdb.gimp_edit_named_cut(temp_layer, "buffer")
pdb.gimp_edit_named_paste(layer, "buffer", TRUE)
pdb.gimp_buffer_delete("buffer")
drawable = pdb.gimp_image_flatten(image)
output_file = pOutput_Path + "//" + title + ".jpg"
pdb.file_jpeg_save(image, drawable, output_file, output_file, 1, 0, 1, 0, "", 0, 1, 0, 0)



register(
"python_fu_generate_card",
"Card Generator",
"Generate images from a template by filling layers from a text file infos (text layers are filled with text, others are filled with image). Genere des images a partir d'un modele en remplissant les calques depuis les informations d'un fichier text (les calques texte sont remplis avec du texte, les autres avec des images).",
"Koin-Koin",
"Koin-Koin",
"2017",
"Cards Generator ...",
"",
[
(PF_FILE, "pCSV_File", "Data file (txt, csv, ...)", "C:/temp/Test.csv"),
(PF_FILE, "pCard_Template", "Template File (xcf)", "C:/temp/Test.xcf"),
(PF_DIRNAME, "pImages_Path", "Images Path", "C:/temp/Images/"),
(PF_DIRNAME, "pOutput_Path", "Output Path", "C:/temp/"),
],
[],
generate_card, menu="<Image>/Filters/Plug-Ins")

main()

Cage causes my system (Mint Mate and Xfce) to freeze when applied. Any ideas around this?

Post has attachment
I thought there was no way to copy layers between images for a long time!

https://www.youtube.com/watch?v=WhP3jd1yEXI

Post has attachment
Make a frame for her or him on Valentine's day. make it a surprise.

Post has attachment
Friendly use tut.

Post has attachment

Post has attachment
#gimp 2.8.20

Post has attachment
I made this script last year to generate several images from the a template and fill them with some text (profile cards for the Deadzone game from Mantic).

So I'm spreading it just in case it could be of any use.

It is far from being perfect as Gimp's script-fu has many flaws in it's implementation and I didn't want to spend too much time on it :
- the text file should be tab separated,
- there should be a dummy column at the end or the last data won't be processed (it was either to work around this way than properly test it in the code, sorry),
- each header in the text file must match an existing text field in the image template or the script will stop (expect for the dummy one),
- default path and name should be edited in the script to match your environment (not required, just more comfy),
- accentuated characters will either crash the script or be ignored.

I found the core code in this thread : http://www.gimptalk.com/index.php?/topic/44309-excel-to-gimp-pluginscript/

I just made it more generic and add the files/path box to fit my needs.

Just cut and paste the code to a text file, save it as script-fu-card-gen.scm in the script folder and restart GIMP.

#GIMP
#CSV
#CardGenerator


(script-fu-register
"script-fu-card-gen" ;func name
"Text Cards Generator" ;menu label
"Generate images from a template\
and fill the matching text fields\
from a text file.\
Génère des images à partir d'un modèle\
et remplis les textes correspondants\
depuis un fichier texte." ;description
"Koin-Koin" ;author
"Most of the code was found in this thread, I just mad it more generic :\
http://www.gimptalk.com/index.php?/topic/44309-excel-to-gimp-pluginscript/" ;copyright notice
"11 octobre 2016" ;date created
"" ;image type that the script works on
SF-FILENAME "Data file (csv,txt)" "C:/temp/Test.csv" ;a file variable
SF-FILENAME "Template File (xcf)" "C:/temp/Test.xcf" ;a file variable
SF-DIRNAME "Output-Path" "C:/temp/" ;a path variable
)


(script-fu-menu-register "script-fu-card-gen" "<Image>/Filters/Customs")



(define (read-line File)
(let* (
(ch (read-char File))
(str "")
)
(while (and (not (eof-object? ch)) (not (equal? #\newline ch)))
(set! str (string-append str (make-string 1 ch)))
(set! ch (read-char File))
)
(if (eof-object? ch)
nil
str
)
)
)



(define (script-fu-card-gen pCSV-File pCard-Template pOutput-Path)
(let* (
(InputFile (open-input-file pCSV-File))
(TheImage "")
(TheLayer 0)
(TheDrawable 0)
(FileHeaderLine "")
(FileFieldLine "")
(CurrentHeader "")
(CurrentField "")
(Title "")
(Output-File "")
(HeaderLine's nil)
(FieldLine's nil)
(RemainingHeader's nil)
(RemainingField's nil)
)

(when InputFile
(set! FileHeaderLine (read-line InputFile))
(set! FileFieldLine (read-line InputFile))
(while (not (null? FileFieldLine))
(set! TheImage (car (gimp-xcf-load 0 pCard-Template pCard-Template)))
(set! HeaderLine's (strbreakup FileHeaderLine (make-string 1 #\tab)))
(set! FieldLine's (strbreakup FileFieldLine (make-string 1 #\tab)))
(set! CurrentHeader (car HeaderLine's))
(set! CurrentField (car FieldLine's))
(set! Title (car FieldLine's))
(set! RemainingHeader's (cdr HeaderLine's))
(set! RemainingField's (cdr FieldLine's))
(while (pair? RemainingHeader's)
(set! TheLayer (car (gimp-image-get-layer-by-name TheImage CurrentHeader)))
(gimp-text-layer-set-text TheLayer CurrentField)
(set! CurrentHeader (car RemainingHeader's))
(set! CurrentField (car RemainingField's))
(set! RemainingHeader's (cdr RemainingHeader's))
(set! RemainingField's (cdr RemainingField's))
)
(set! TheDrawable (car (gimp-image-flatten TheImage)))
(set! Output-File (string-append pOutput-Path "\\" Title ".jpg"))
(file-jpeg-save RUN-NONINTERACTIVE TheImage TheDrawable Output-File Output-File 1 0 1 0 "" 0 1 0 0)
(set! FileFieldLine (read-line InputFile))
)
)
)
)



Sorry for my question but why groupes don't have a fusion's mask today.
I have GIMP 2.95 Dev. In the old days, groupes had a fusion mask directly on it.
Why not today?
Wait while more posts are being loaded