Help with batch processing composite overlay! Thanks!

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
nanosubmarine
Posts: 1
Joined: 2017-05-25T09:33:57-07:00
Authentication code: 1151

Help with batch processing composite overlay! Thanks!

Post by nanosubmarine »

So I have several hundred files... and I'd like to batch process them using Imagemagick's composite module.

Essentially what I'd like to do is overlay Ia000.ps over Ib000.ps and the output will be Iout000.ps.

This works for a single file as: composite -density 300 -blend 75% Ia000.ps Ib000.ps Iout000.ps

But I am getting an error when I run it in a batch shell script. I'd like to do this for:
Ia000.ps + Ib000.ps = Iout000.ps
Ia001.ps + Ib001.ps = Iout001.ps
Ia002.ps + Ib002.ps = Iout002.ps
Ia003.ps + Ib003.ps = Iout003.ps
Ia004.ps + Ib004.ps = Iout004.ps
Ia005.ps + Ib005.ps = Iout005.ps
you get the gist :) but for like... a hundred files so up to Iout1000.ps
This is the script I tried:
_______________
for %i in $seq(000 001 002 003 004 005);
do
echo \
composite -density 300 -blend 75% I{a,b}${%i}.ps $Iout{%i}.ps
done
_______________________________________
The error I am getting is line 6: '%i' : not a valid identifier I am new to unix still sort of, and I know it must be something silly I am missing but would really appreciate any help! Thanks so much :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Help with batch processing composite overlay! Thanks!

Post by snibgo »

What shell language are you using? Bash, Windows BAT, or something else?

Also: what version of IM are you using? (Although that doesn't matter, as your script isn't getting that far.)
snibgo's IM pages: im.snibgo.com
Post Reply