Page 1 of 1

Even most basic montage not producing anything usable linux

Posted: 2013-08-12T10:39:31-07:00
by kbfirebreather
I'm trying to use the montage command for the most basic tasks, but am having troubles getting anything to work right. I've spend a few hours searching online for a possible solution but have come up empty handed and was hoping someone could steer me in the correct direction.

I just want to put (n) photos stitched together.

The 4 images I'm attempting to test this on are: http://imgur.com/a/wjmYS

I tried quite a few different commands to see what kind of output is generated.

Test #1:
>montage *.jpg out.jpg
OR
>montage 1.jpg 2.jpg 3.jpg 4.jpg out.jpg

This is the result of out.jpg: http://imgur.com/wiphorO

Nothing! An unreadable image file. I found this to be quite strange since this is one of the most basic tasks as illustrated at http://www.imagemagick.org/Usage/montage/

I then tried the montage command linked by that example to http://www.imagemagick.org/www/montage.html

Test #2:
>montage -background #336699 -geometry +4+4 1.jpg 2.jpg out.jpg

this just ended up showing the usage in the command line, like I was using it wrong. I figured it really doesn't like that background flag, so I'll try it without it...

Test #3:
>montage -geometry +4+4 1.jpg 2.jpg out.jpg

This produced the same thing as test #1. A much larger, unreadable file.

At this point, I figured I would try something else. Let's convert an image.

Test #4:
>convert 1.jpg 1.png

Again...an unreadable file.

Finally I tried this:
>montage *.jpg -geometry +2+2 out.jpg

Which produced this: http://imgur.com/oAkK01U

Not sure what happened there, but at least it's not a completely unreadable file.

I thought maybe I was missing some dependencies for imagemagick, but after searching around that doesn't seem to be the case. What I found was there are no required dependencies?

I'm doing this on Ubuntu Server 12.04.
This is what displays from montage: Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC

My end goal is to use montage in a DIY photo booth build for my wedding next year to stitch together photos and send it off to a printer.

Any idea what's going on? Thank you for any help.

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T10:43:51-07:00
by fmw42
You need to tell montage the -tile arrangement.

montage image1 image2 image3 image4 -tile 4x1 result

will put them all in a row and is the same as doing

convert image1 image2 image3 image4 +append result

if you want them in a vertical column, then use -tile 1x4 or use -append.


If you want them in a 2x2 arrangement, then use -tile 2x2.

See if that works. If not tell us what arrangement you want and how much spacing between them and background and/or labels


see
http://www.imagemagick.org/Usage/montage/
http://www.imagemagick.org/Usage/layers/#append

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T11:02:02-07:00
by snibgo
kbfirebreather wrote:Version: ImageMagick 6.6.9-7
That is a very old version of IM. An upgrade may be useful.

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T11:38:04-07:00
by glennrp
Maybe you are missing the 3rd party libraries for PNG and JPEG.
Try "convert -list format" to see if you have PNG and JPEG support.

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T11:39:21-07:00
by kbfirebreather
fmw42 wrote:You need to tell montage the -tile arrangement.

montage image1 image2 image3 image4 -tile 4x1 result

will put them all in a row and is the same as doing

convert image1 image2 image3 image4 +append result

if you want them in a vertical column, then use -tile 1x4 or use -append.


If you want them in a 2x2 arrangement, then use -tile 2x2.

See if that works. If not tell us what arrangement you want and how much spacing between them and background and/or labels


see
http://www.imagemagick.org/Usage/montage/
http://www.imagemagick.org/Usage/layers/#append
Even with the -tile flag, it still produces a file that is unreadable like from Test #1. I was hoping just to get montage to produce something from the most basic example of 'montage *.jpg out.jpg' and go from there. But it seems that every attempt I make even with the -tile flag it generates an unreadable file.
snibgo wrote: That is a very old version of IM. An upgrade may be useful.
I installed through apt-get. Might have been mistake. Uninstalled that and installed from source. Now am running 6.8.6-8.

It appears that installing from source, I'm missing some delegates. The only ones imagemagick sees are ps and mpeg. Trying to figure out how to get the jpeg delegates and what not installed and registered with imagemagick. Will report when I have something.

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T15:50:32-07:00
by fmw42
On unix, you need to install any delegates that you want to use before installing IM from source. This is easy on a Mac via MacPorts, but with Linux, I understand it is not so easy unless you have an RPM. Any way here is a list of delegates, but I would try to find current ones by searching Google.

see
http://www.imagemagick.org/download/delegates/

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T17:49:32-07:00
by kbfirebreather
Okay, so I uninstalled ImageMagick, and attempted to install some jpeg delegates and reinstall ImageMagick. I thought I installed 2, but when I run convert -list configure, it only lists ljpeg as a jpeg delegate. The other ones listed are lMagickCore, lm, and lgomp. After doing this, it is now working! Thank you for the help!

Re: Even most basic montage not producing anything usable li

Posted: 2013-08-12T17:55:53-07:00
by fmw42
Some delegates require other dependent delegates. So check your install log to see if there are any errors due to missing dependencies.