Switch to full style
Ask all general Gimp related questions here
Post a reply

Script request

Thu Feb 03, 2022 7:56 am

GIMP Version: 2.10.28
Operating System: Linux
GIMP Experience: Experienced User



Does anyone know of a script which could generate layers with sequential numbers -- like page numbers -- perhaps with the options to select sequence quantity, font selection, font size and color? Maybe even location -- i.e bottom or top right/bottom or top left?

Thanks!

Re: Script request

Thu Feb 03, 2022 9:23 am

Not Gimp Maybe look at ImageMagick. IM has the ability to join several tiff files into a single multi-page tif that Gimp can open.

The bare bones, it boils down to how many command line variables you want to add, so for font size and position edit the script. So for this
Code:
sh pages.sh 400 800 "I love Gimp" 6

You get 6 annotated pages in one file

Code:
#!/bin/bash

# use sh pages.sh width height "caption in quotes"  number of pages
# make the pages and number them
for i in $(seq 1 1 $4)
do
convert -size $1x$2 xc: $i.tif
mogrify  -gravity South -pointsize 40 -annotate +5+5 "$3"  $i.tif
mogrify  -gravity SouthEast -pointsize 40 -annotate +30+5 "$i"  $i.tif
done

# make multi-page tif
convert *.tif multi.tif

# Delete the redundant files
for i in $(seq 1 1 $4)
do
rm $i.tif
done


pages.jpg
pages.jpg (116.01 KiB) Viewed 735 times

Re: Script request

Thu Feb 03, 2022 10:54 am

Hi Nixnine.

Is it so hard? :hoh
Only as an exception for You: ;)
https://www.gimpscripts.net/2020/10/add ... ayers.html

Re: Script request

Thu Feb 03, 2022 12:35 pm

Thanks, MareroQ, that works great.

I ran it for 250 numbers and then batch saved each layer as a separate image.

Thanks again!
Post a reply