Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a tool in Ubuntu to automatically merge two images having a common strip? I need to scan a large image, which will not fit at once in the scanner. I was thinking about scanning it in two parts and hand-editing the result in Gimp to join them. But probably an automatic tool can do the same more quickly and better.

EDIT I think I may have not made my point clear. My difficulty is not aligning two images. My problem is that one has to compensate for the rotation or distortion introduced by the manual process of putting the sheet into the scanner, and an automatic tool should obtain more precise results at analyzing common patterns in the two images to rotate and align them seamlessly.

share|improve this question

4 Answers 4

You can easily achieve that with Gimp.

1)Make a new file File->New

At the "create new image" dialog add the desired height and width.That will give you your new file which may look like this (depending on the dimensions you set) :

2)Open the two images you want to merge from File -> Open...

3)Then click copy at the image Edit -> Copy...

4)Go to the empty file you created first at step 1 and paste the images (Copy and paste the first image and then copy and paste the second) Edit -> Paste

5)Position the two images using the "Move" option from the Toolbox

When the pasted image is where you want it, set it in place. Either move your cursor on the canvas until you see a little anchor symbol, or click "Layer" on the Toolbar, then select "Anchor":

6)Scale the new file with the two merged pictures Image -> Scale Image...

share|improve this answer
    
This is what I was thinking to do. Then again, probably an automatic tool can do the same more quickly and better. My point is that an automatic tool should align things better than I do by hand. –  Andrea Jul 22 '12 at 16:47
    
I am not aware if there are any programs for such a simple thing really.But still, I am sure you cannot be THAT lazy..it won't take you more than 5 minutes :) –  Nickolas Jul 22 '12 at 19:52
    
The point is not laziness. Putting the big sheet into the scanner produces two images that are slightly rotated, and I need to compensate for that. Doing that by hand so that the result is seamless is not so easy –  Andrea Jul 22 '12 at 20:05

Using the tools provided with ImageMagick

Install via the software center

We can easily join, i.e. "montage" images into one large image with the following command

montage -geometry 500 image1 image2 [...] output

See the project page for many parameters of the geometry option. In the example above all images will be scaled to a width of 500 pixels before they are joined. Adapt this value for your image sizes. In case you need to have a fixed height choose x500 instead. The other dimension will be scaled to preserve the aspect ratio.


For a more sophisticated way to assemble images you may want to search for panorama photo stitcher software such as hugin Install hugin

Install via the software center

or the Pandora plugin for Gimp.

share|improve this answer
    
Will montage automatically match similar parts in the two images? –  Andrea Jul 22 '12 at 20:06
    
Sorry, then this is not what I am looking for. The whole point of the question is finding a tool that will match similar parts in the two images automatically. –  Andrea Jul 22 '12 at 20:10
    
you are the best :) –  stupidity Nov 6 '13 at 3:18
    
@Andrea: have you found any way to solve your problem? Montage is not for you, but have a look at other command: imagemagick.org/script/command-line-tools.php –  Ooker Jul 18 at 12:25
    
see this page to learn more about -geometer option: imagemagick.org/script/command-line-processing.php#geometry –  Ooker Jul 18 at 13:17
up vote 1 down vote accepted

I finally settled for Hugin. It requires some manual intervention, but has produced a really good result.

Here is a tutorial that explains how to use Hugin so that it will not try to deform your flat images (the tool was born to produce panorama images from single pictures, hence it usually compensates for the prospectic effects).

share|improve this answer
    
why don't you accept this? –  Ooker Jul 18 at 17:23

I've successfully joined jpg's into panorama by using a program called fotoxx. It has a tool for just that purpose under the toolbar "Combine"

share|improve this answer
    
Aha. Now how can I install and use that program? Is there any procedure? –  Braiam Nov 30 '13 at 18:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.