Hugin's align_image_stack tool seems to be highly recommended for photos. It may well work in such cases where you have EXIF data, the images are all the same resolution and taken from roughly the same position.

However, what if I just have 2D transformations I'd like to align. No fancy "field of view", 3D position optimizations that expect the images to be of a 3D scene. Lets say I just have two images with identical content. The only difference is one has a margin or the other is cropped a little. Maybe one is a different resolution. At the extreme end, colours may have been changed slightly or there's a watermark/text in the way.

For example...

enter image description here enter image description here

Is there a simple command line tool I can use to align these two images?

I'm using linux, but something cross platform would be great.

> align_image_stack -a out_ a.png b.png 
Unable to read EXIF data from opened file:a.png
Unable to read EXIF data from opened file:b.png
Segmentation fault (core dumped)
  • Photoshop seems to have no problem aligning your images, since you can run Photoshop form command line would that suffice. Mathematica did do this also pretty easily, and that too can be used form commend line. Would these suffice or are you looking for cross platform as in FREE?
    – joojaa
    Commented May 14, 2015 at 9:54
  • @joojaa thanks, but sorry I'm on linux, don't own photoshop and need a command line tool.
    – jozxyqk
    Commented May 14, 2015 at 9:56
  • Photoshop can be used to merge from commend line. would mathematica suffice. See my edit
    – joojaa
    Commented May 14, 2015 at 9:57
  • Yes, open source is definitely the preference here. I don't want it that much to pay 100s for it.
    – jozxyqk
    Commented May 14, 2015 at 10:38

1 Answer 1

  • The plugin for gimp gimp-image-reg can do this, you can then use the scripting layer of gimp to make this usable on command line.

  • Then there is also Limereg

  • Ive also tested python-register which should also not be hard to implement a commendline with.

  • Thanks for your time! I had a crack at gimp-image-reg. After adding the -lm it built, installed and even moved my test images, unfortunately not aligning them. limereg appears to be just a library without an executable, but definitely worth a look, as with the python lib.
    – jozxyqk
    Commented May 14, 2015 at 12:01

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.