how do you vertically stack every 4 images into 1 image?

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?".
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

how do you vertically stack every 4 images into 1 image?

Post by User »

Image

how do you vertically stack every 4 images into 1 image?
on mass. with 1000 images.

on mass. fast. not manually. this example was made manually

they're all the same resolution and in the correct order in name and time

please explain it easily for a beginner

i can not into code

thanks

pic related. its what i'm trying to do
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

i got this to work in command prompt after installing imagemagick

Code: Select all

convert *.png[400x400] -splice 0x10 -background "#ffffff"  -append  -crop -0+10  output.png
but it combines every single image into 1 vertical imag
it doesn't vertically stack every 4 into single images with all of the

copy pasted from here
http://gotofritz.net/blog/geekery/combi ... agemagick/

i can not into code
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how do you vertically stack every 4 images into 1 image?

Post by Bonzo »

Are you planning on doing this on Windows, Linux or Mac. Do you want to use a batch script, shell script or php. What Imagemagick version do you have.

I would guess you would need to read in 4 images at a time and do it that way with a shell script or similar.
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

Bonzo wrote:Are you planning on doing this on Windows, Linux or Mac.
windows 7 64-bit
Bonzo wrote:Do you want to use a batch script, shell script or php.
i can not into code
Bonzo wrote:What Imagemagick version do you have.
ImageMagick-6.8.5-6-Q16-x86-dll.exe
Bonzo wrote:I would guess you would need to read in 4 images at a time and do it that way with a shell script or similar.
i dont know
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

advice i got from a chat room
I don't know about the command line tools but at least in perlmagick, Montage does exactly that; so probably the same in command line tools
well the "montage font_*.gif -tile 4x1 -geometry +2+2 multi_%d.gif" example is almost exactly your case
except that you have -tile 1x4 -geometry +0+0

Code: Select all

montage  font_*.gif  -tile 1x4 -geometry +0+0  multi_%d.gif
didn't work

here's the pictures from that example picture
http://www.mediafire.com/download.php?7mmkgsbe7ro738s

http://pastebin.com/kHjnZ0AB
i dont know what i'm doing
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how do you vertically stack every 4 images into 1 image?

Post by Bonzo »

I think you problem is your images are png not gif and they do not start with font_

This code works for me:
montage C:\Users\Administrator\Pictures\TEST\*.png -tile 1x4 -geometry +0+0 C:\Users\Administrator\Pictures\TEST\multi_%d.png
This is run from the command prompt and the original images are in a folder on my C:\Users\Administrator\Pictures\TEST\

Start the comand prompt which is in the START > Accesories folder ( I run as administrator )
When it loads put in cd\ and press enter
Copy and paste ( not control V ) the code from above with your path to the original images and the save path and press enter.

The filename is not in the format you wanted but if it works that can be looked into afterwards.
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

thanks!

this code works

Code: Select all

montage C:\Users\User\1\test2\*.png -tile 1x4 -geometry +0+0 C:\Users\User\1\test2\multi_%d.png
questions

how do you get it to name files starting from 1 instead of 0?

how do you get it to name files starting from any number instead of 0?

how do you get it to only use images of a certain resolution?

Code: Select all

montage *.png[800x600] -mode concatenate  -tile 1x4  output.png
i thought putting "[800x600]" there would work but it didn't
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

User wrote: here's the pictures from that example picture
http://www.mediafire.com/download.php?7mmkgsbe7ro738s
i dont know what i'm doing
that example is crap

they're only numbered so there's no file names to equate to real images

here's a better 1

http://www.mediafire.com/download.php?au638n4vcw8t36c
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

i got the solution to not have stacked images stack on top of eachother

"*.png" are all the files imagemagick montage is looking to convert

Code: Select all

montage *.png  -tile 1x4 -geometry +0+0 output-%d.png
so make "*.png" into "*input[or whataver filename].png"

Code: Select all

montage *input.png  -tile 1x4 -geometry +0+0 output-%d.png
so there's a difference between the input and the output files

so it won't read the output files and output them again

new problem

everytime new images are outputted they overwrite the old images

how do you change the starting number of the output file?

or the solution can be from the answer to a question i didn't ask like before
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how do you vertically stack every 4 images into 1 image?

Post by fmw42 »

User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

doesn't work

Code: Select all

C:\Users\User\1\rectvert>montage *vert.png -tile 1x4 -geometry +0+0 -scene 2
5 vert.png
montage.exe: unrecognized option `-scene' @ error/montage.c/MontageImageCommand/
1551.

C:\Users\User\1\rectvert>
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how do you vertically stack every 4 images into 1 image?

Post by fmw42 »

-scene is for convert not montage. All it does is set the scened number and not select the image. Sorry I miss that part of your post.

You would likely have to script a loop to take four images and montage or append, then skip 4 and take the next four, etc. I am not a windows user so cannot help with the code. One of the windows users will have to help.
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

fmw42 wrote:-scene is for convert not montage. All it does is set the scened number and not select the image. Sorry I miss that part of your post.
i wish convert was for montage. that's alright
fmw42 wrote:You would likely have to script a loop to take four images and montage or append, then skip 4 and take the next four, etc. I am not a windows user so cannot help with the code. One of the windows users will have to help.
i don't know either. thanks
User
Posts: 13
Joined: 2013-05-19T01:13:51-07:00
Authentication code: 6789

Re: how do you vertically stack every 4 images into 1 image?

Post by User »

i think theres a way to solve this with the output file name

question

how do you make the output filename the same as original but with suffixes?

how would this even work? combining multiple images.
would it take the filename of the first image used?

that way it probably won't write over files because they're differnet filenames
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how do you vertically stack every 4 images into 1 image?

Post by fmw42 »

This seems to work fine for me on IM 6.8.5.6 Q16 Mac OSX Snow Leopard

Make test images:
convert rose: rose1.jpg
convert rose: -rotate 90 rose2.jpg
convert rose: -rotate 180 rose3.jpg
convert rose: -rotate 270 rose4.jpg

Do montage:
montage rose*.jpg -geometry +0+0 -tile 1x2 results_%d.jpg

I get results_0.jpg and results_1.jpg. 0 has rose1 and rose2 appended vertically. 1 has rose3 and rose4 appended vertically.
Post Reply