Page 1 of 1

Help with batch processing composite overlay! Thanks!

Posted: 2017-05-25T09:36:19-07:00
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 :)

Re: Help with batch processing composite overlay! Thanks!

Posted: 2017-05-25T09:49:27-07:00
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.)