Re: how to use ImageMagick to remove punch holes?
Posted: 2016-11-11T13:37:57-07:00
There are many ways of doing "for" loops, and it's outside the scope of this forum, but this should get you started.
You currently have a script that takes an input file called 1.jpg, and an output file called h_bf.png. What is this script called? I'll pretend it is called "myscript.bat".
Change all occurrences of 1.jpg to %1.
Change all occurrences of h_bf.png to %2.
Now, whenever you call this script, you need to provide these two parameters. Test it to make sure it works:
Then you can write another script that contains something like:
You currently have a script that takes an input file called 1.jpg, and an output file called h_bf.png. What is this script called? I'll pretend it is called "myscript.bat".
Change all occurrences of 1.jpg to %1.
Change all occurrences of h_bf.png to %2.
Now, whenever you call this script, you need to provide these two parameters. Test it to make sure it works:
Code: Select all
call myscript 1.jpg new_out.png
Code: Select all
for %%F in (*.jpg) do call myscript %%F %%~nF.png