What is the easiest way (ideally automated) to perfectly align two almost identical images?

The challenge: I have two images that I wish to perfectly align over the top of each another. The images are largely identical (save for fine details and noise), but are not of perfectly equal proportion; so simply rotating one to match the other is not sufficient - further subtle manipulation/warping would be required to have them perfectly overlay.

With high resolution images, I can accomplish this goal using a traditional image editor (such as, but not limited to, Photoshop) - but achieving near-perfect alignment is a very time consuming and manual process.

Does anyone know of a way in which I could accomplish this very easily (ideally, in a largely automated fashion)? My concept of a perfect solution would be to tell an application which image was the 'template', and then to have it distort the second image to match the template as closely as possible.

Although I'm comfortable with Photoshop, I'm very happy to consider any other applications that might help me to accomplish this.

Assuming the question might be asked, the reason I'm trying to do this, is that I can create incredibly clean (and sharp) scans from matte paper pages by creating two scans of the same page at 90 degree rotations - and then isolating and removing almost all noise picked up from the paper texture using blend modes. Unfortunately, scanning the image in different orientations creates subtle distinctions in the proportions of each scan - such that the images will not match up through rotation alone.

Thanks in advance for any thoughts.

• Not sure I understand. Could you not just highlight the layers in Photoshop and click the align buttons?? – Scott Sep 22 '16 at 0:55
• Sorry if I've not explained this well - I'll try to add some images later to better clarify what I mean, as it is tricky to explain. Essentially, the images don't perfectly match up even if aligned and rotated. That is, if you align the top-left and bottom-right corners perfectly, you'd THINK that the rest of the image would match - but instead, portions of the middle, and the remaining corners do not perfectly overlay ... as though one image had been irregularly warped by being left in the sun. It's quite subtle - but when trying to preserve sharpness across the image, it's disastrous. – Hobbes Sep 22 '16 at 1:09