How to align layers with GIMP or other tool?

Hi,

I’m learning to use GIMP to process multiple shots taken with bracketting exposures. As some were shot handheld, the pictures are not exactly aligned. Is there a way in GIMP to auto align the layers based on the subjects (like a mountain)? somebody suggested to use Hugin, I’ve installed it, but it looks more like a standalone tool for stitching panorama shots? Is there any plug-in for GIMP that does the layer auto alignment? Or any other tools?

thanks,

Jason

I’m not aware of any function or plugin for gimp to do this. Back in the day, I’d set the layer opacity low and line them up by hand.

Hugin is the right answer here, and we have an article on how to do exactly what you’re asking: PIXLS.US - Aligning Images with Hugin

1 Like

Get ofn-align-layers. Basically you create a path with 4 points, the first two on the reference layer and the last two on the adjusted layer. Then you call the script (the adjusted layer need to be the active layer) and the script scales/rotates/translates the layer so that the two pairs of point match. The great benefit of this method is that there is one single transform applied, a manual adjustment often implies several transforms so you have lore image degradation due to pixel interpolations.

However, if you are trying to match two hand-held shots, you will likely get a better result with Hugin (which will compensate for the changes in camera axis). But then the script is quick to install and check…

1 Like

There is a simple script bundled with Hugin that can do this automatically for you: align_image_stack.

/path/to/align_image_stack -a OUT file1.tif file2.tif ... fileX.tif

I talked about using it a while back here also:

https://patdavid.net/2013/01/focus-stacking-macro-photos-enfuse.html#hugin-align-images

So far as I can tell, align_image_stack only outputs an HDR file (exr?). I have yet to convince it to output a tif.

Really? I’ve only ever gotten a tif output…

I’ll double check later to make sure I’m not mistaken!

I’ve been using align_image_stack sporadically over the years, it outputs TIFF files but IIRC without metadata, so I copy over the metadata from the input files into the output files using ExifTool.

align_image_stack man page: align_image_stack man page - hugin-base - General Commands

Usage:
align_image_stack --gpu -a ais_ -m -d -i -C -e 1.tif 2.tif 3.tif

-m = optimize field of view, useful for macro stacks.
-d = optimize radial distortion.
-i = optimize image center shift.
-C = auto-crop result.
-e = input image are fisheye.

To copy metadata: G'MIC request: keep exif info - #4 by Morgan_Hardwood

1 Like

Thanks for your suggestions. I tried Hugin with just two images, taken on tripod, and at 1:1, I could see ghosting, so it’s not doing such a good job in aligning the two images.

Did you try Hugin or then align_image_stack command?