GIMP Chat
http://gimpchat.com/

Script request
http://gimpchat.com/viewtopic.php?f=8&t=19808
Page 1 of 1

Author:  nixnine [ Thu Feb 03, 2022 7:56 am ]
Post subject:  Script request

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!

Author:  rich2005 [ Thu Feb 03, 2022 9:23 am ]
Post subject:  Re: Script request

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
sh pages.sh 400 800 "I love Gimp" 6

You get 6 annotated pages in one file

#!/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


Attachment:
pages.jpg
pages.jpg [ 116.01 KiB | Viewed 740 times ]

Author:  MareroQ [ Thu Feb 03, 2022 10:54 am ]
Post subject:  Re: Script request

Hi Nixnine.

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

Attachments:
Number Layer.png
Number Layer.png [ 447.61 KiB | Viewed 714 times ]

Author:  nixnine [ Thu Feb 03, 2022 12:35 pm ]
Post subject:  Re: Script request

Thanks, MareroQ, that works great.

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

Thanks again!

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/