Combine/Stack image files

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?".
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Combine/Stack image files

Post by Axelotl »

Hey complete newbie here,

I read a few people who used ImageMagick to stack/combine image files together in a sequence but they didn't say how.

The files I downloaded were split into separate image files in seperate folders, for example the image is chopped up into 3 different image files.

I could do this manually with any other image editor however the problem is that there are many pages of these split up images and it'll take too long.

How do I do this?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Combine/Stack image files

Post by Bonzo »

You need to post an example of what you are talking about - or a link to an online example - stack/combine can mean lots of different things.

It may involve some other code like a shell script or batch file; how were you going to run the code?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Combine/Stack image files

Post by Bonzo »

Just looked up some examples, select the image for the code:
Image

Image

Image

Image
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

I'm not exactly sure about the code that's why I'm asking, I just need it to produce the result I'm looking for.
It's kind of like the last two but with no special effects, just cleanly put together.
I'm not splitting one image I'm doing the opposite.

I'll give you an example.

Image

Every page has a folder containing 1 picture split into separate image files.
I used the Save Image firefox extension and that's how it saved the pages.
Ultimately I just want to join them so it's just 1 clean image file.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Combine/Stack image files

Post by fmw42 »

Code: Select all

convert 1.jpg 2.jpg 3.jpg -append result.jpg
see
http://www.imagemagick.org/Usage/layers/#append
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

Thank you so much!
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

Okay I figured out how to do it to one folder but how do I do it to many sub-directories in one go?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Combine/Stack image files

Post by fmw42 »

script a loop over each directory and subdirectory
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

I'm a complete newbie, how do I script a loop over all the directories?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Combine/Stack image files

Post by Bonzo »

What operating system are you using and if on a server are you going to use something like php?
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

Windows 8, I just run them through the console.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Combine/Stack image files

Post by fmw42 »

Sorry, one of the Windows user would have to help you with a bat script file. I only know Unix (Mac)
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

Anyone?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Combine/Stack image files

Post by snibgo »

To loop over files in a direcory tree in Windows, I would use "for /D". Eg:

Code: Select all

for /R \mydir\images %D in (*.jpg) do identify %D
Type "for /?" for help.
snibgo's IM pages: im.snibgo.com
Axelotl
Posts: 13
Joined: 2014-03-07T08:17:46-07:00
Authentication code: 6789

Re: Combine/Stack image files

Post by Axelotl »

I ran that exact line and it listed all the files but with something like "identify.exe: unable to open image/no decode delegate for this image format"

How do I use this loop in my situation? If I was applying it to only one folder it would be:

Code: Select all

convert image.jpeg image_001.jpeg image_002.jpeg image_003.jpeg -append appended_image.jpeg
Post Reply