Do you know any open source tool to automatically align images, similar to the auto align feature in Photoshop?

  • \$\begingroup\$ Hi Max. Welcome to photo-SE. I think you'll find what you're looking for at this earlier question. photo.stackexchange.com/questions/230/…. It doesn't mention "alignment" in the Q, but since that's a vital step for panoramas, all the answers cover it. \$\endgroup\$
    – mattdm
    Jun 5, 2011 at 12:43
  • 1
    \$\begingroup\$ Also see photo.stackexchange.com/questions/12233/… \$\endgroup\$
    – mattdm
    Jun 5, 2011 at 12:47
  • 1
    \$\begingroup\$ My problem is that I do not want to create panoramas, but to align stereoscopic images. \$\endgroup\$
    – bot47
    Jun 5, 2011 at 14:40
  • \$\begingroup\$ The software should generally be the same, I think (see the second link for a non-panorama case), although I don't know about stereoscopic images in particular. \$\endgroup\$
    – mattdm
    Jun 5, 2011 at 15:51
  • \$\begingroup\$ This is also useful for HDR. BTW, I'm still looking for a simple program to do this :) \$\endgroup\$
    – Itai
    Jun 5, 2011 at 20:28

4 Answers 4


Alignment of multiple images taken from the same point

If you are not making a panorama, but just aligning an image stack for focus stacking, exposure fusion or HDR, then align_image_stack from Hugin project is one of the simple yet very useful tools. Hugin is a multiplatform collection of tools that is available for Windows, Mac OS, and Linux.

For example, if your have 3 files a.jpg, b.jpg, c.jpg, to align them you may run:

align_image_stack -a aligned_ a.jpg b.jpg c.jpg

which will produce three TIFF images, aligned_0000.tif, aligned_0001.tif and aligned_0002.tif, which will be well aligned. Now the images are ready to be, for instance, enfused:

enfuse aligned_*.tif

If you prefer the graphical interface, or you want to align only partially overlapping images (like in panoramas), then use Hugin itself, it is a very powerful and flexible software.

Alignment of stereo pairs

From your comments I see, that you want to create stereoscopic images. The keyword to search for is anaglyph, not align.

For this purpose I used Stereo Photo Maker, which is not open source, just a free Windows program. It runs well under wine too. But I almost never used its automatic alignment feature, because I prefer to align images manually, watching the composite 3D image. By aligning the images manually I can also choose what exactly is “in focus” (one cannot align everything in a stereo image).

SPM can also optimize color anaglyphs to reduce ghosting, a very useful feature.

There are some scripts and tutorials for Gimp (e.g. anaglypher, script-fu-make-anaglyph, this short tutorial). It is relatively easy to build a monochrome anaglyph through layer effects and by moving a layer manually, it is not always working well for color anaglyphs.

Finally, there is -stereo option of composite command of ImageMagick, but I didn't use it.

  • 1
    \$\begingroup\$ Actually I didn't mention the word stereo nor anaglyph intentionally. Compositing the anaglyphs from two images is not the problem. align_image_stack actually has extra support for stereo images which does not work as expected. I've already contacted the author of the specific code. \$\endgroup\$
    – bot47
    Jun 7, 2011 at 8:25
  • \$\begingroup\$ Oh, I didn't know about that new feature, my version of align_image_stack doesn't have it. Thanks, nice to know. \$\endgroup\$
    – sastanin
    Jun 7, 2011 at 10:00
  • \$\begingroup\$ If you try, please tell me. I couldn't get it to work in the way I understand the commands. Try -C -S and -A \$\endgroup\$
    – bot47
    Jun 7, 2011 at 13:35

If this is in order to get a nice animation of the images, you can use Google Photos. Then, once they are in your library, select the images you want, click the big plus in upper right, and select Animation. A few seconds later, you have an animation of the aligned images.

This is as of 10/01/2017

  • \$\begingroup\$ Maybe they've changed something since 2017, but I just tried Google Photos as suggested and -- animation, yes; alignment, no. \$\endgroup\$
    – Chris
    Nov 27, 2020 at 3:38

From http://en.wikipedia.org/wiki/AutoStitch

"Autostitch uses methods known as SIFT and RANSAC. This program differs from some other image stitching software in that it automatically stitches together even unaligned or zoomed photographs seamlessly without user input, whereas others often require the user to highlight matching areas for the photographs to merge properly. The only requirement is that all photographs be taken from a single point."

Free demo for Windows (which works seamlessly on Linux under Wine) is available, and I never needed another tool for stitching of pics.

As mattdm correctly wrote above (in comment), this is similar question: Which tools are good for creating panoramas/stitching multiple photos? and autostitch is also there one of the answers. I love (and prefer) it for two reasons: - simple installation (one exe file, nothing to install) - simple to use - choose input pics, choose size of output image, and other settings you do not need to set/change if you don't want to

So it's not exactly open source, but it is free (demo), simple and works fine both on Windows and Linux.


Hugin's command-line align_image_stack has arguments for dealing with stereo pairs. You need to experiment with the settings, particularly the grid subdivision count -g, the point count -c and the prescale -s (larger images need to be scaled down more for the point detector to work reliably). Also make sure you pass in the FOV with -f. Here's a command line that generates a super-excellent stereo pair from two 1920x2560 images:

align_image_stack -f 35.09 -p stereotest.pto -a stereotest -v -g 3 -c 16 -i -d -s 3 -S -C -A -P P9010741.JPG P9010742.JPG

  • \$\begingroup\$ Yeah, I found that, but it didn't work for me. Don't ask me why. I wrote the author of the patch, but he didn't respond. \$\endgroup\$
    – bot47
    Sep 7, 2011 at 8:25
  • \$\begingroup\$ I get a segmentation fault when i try this command. :( \$\endgroup\$ Jan 28, 2015 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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