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?".
RyanBram
Posts: 30 Joined: 2013-03-25T22:55:10-07:00
Authentication code: 6789
Post
by RyanBram » 2014-02-09T10:23:55-07:00
Let's say, I have two sets of images, in two different folder (directory)
First directory contains:
A.png ; B.png; C.png
Second directory contains:
1.png ; 2.png; 3.png
How to combine (composite) those two into third set and become:
A1.png; A2.png; A3.png;
B1.png; B2.png; B3.png;
C1.png; C2.png; C3.png;
I already read
http://www.imagemagick.org/Usage/files/ and try something like
, but still cannot find (or not aware) the correct method.
Regards.
Last edited by
RyanBram on 2014-02-09T22:02:21-07:00, edited 1 time in total.
OS: Windows 7 Ultimate, 32-Bit
CPU: Intel Core i3 2350M @ 2.30GHz
RAM: 2.00 GB Single-Channel DDR3 @ 665MHz
IM Version: 6.8.3-8 2013-03-04 Q16
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2014-02-09T10:29:16-07:00
In a Windows BAT script:
Code: Select all
for %%a in (dir1\*.png) do (
for %%b in (dir2\*.png) do (
convert %%a %%b {something} %%a_%%b_out.png
)
)
RyanBram
Posts: 30 Joined: 2013-03-25T22:55:10-07:00
Authentication code: 6789
Post
by RyanBram » 2014-02-09T11:00:29-07:00
Code: Select all
for %%a in ("%~d0%~p0Original\*.*") do ( for %%b in ("%~d0%~p0Mask\*.png") do ( "%~d0%~p0bin\imagemagick\convert" "%%a" ( "%%b" -negate ) -alpha off -compose copy-opacity -composite "%~d0%~p0Result\%%~na%%~nb.png" ) )
That's my script. But the result is only the console who appear and disappear immediately without I noticed what message it tries to tell.
Something wrong with my script?
OS: Windows 7 Ultimate, 32-Bit
CPU: Intel Core i3 2350M @ 2.30GHz
RAM: 2.00 GB Single-Channel DDR3 @ 665MHz
IM Version: 6.8.3-8 2013-03-04 Q16
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2014-02-09T11:08:24-07:00
It's hard to say without peering over your shoulder, but you probably need to escape the parentheses:
RyanBram
Posts: 30 Joined: 2013-03-25T22:55:10-07:00
Authentication code: 6789
Post
by RyanBram » 2014-02-09T11:13:44-07:00
It works. Thank you very much, Snibgo.
Problem Solved. (I don't know how to mark problem as solved)
OS: Windows 7 Ultimate, 32-Bit
CPU: Intel Core i3 2350M @ 2.30GHz
RAM: 2.00 GB Single-Channel DDR3 @ 665MHz
IM Version: 6.8.3-8 2013-03-04 Q16
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2014-02-09T11:58:00-07:00
RyanBram wrote: It works. Thank you very much, Snibgo.
Problem Solved. (I don't know how to mark problem as solved)
Edit the title of your very first post on this topic