How can I easily correct slight rotational misalignment in scanned images

I've got a whole lot of scanned images (> 500) the majority of which were scanned with the paper not completely square. They need to be rotated about 1-5 degrees to be aligned again.

Is there any software that does this? I know some scanner drivers do but mine doesn't seem to.

Update: It seems that thing I want here might be Image Registration software.


I use Google's Picasa desktop application on Windows (link to UK download page) for organizing and minor editing of my photos. This is one of the things it does very well.

When you rotate an image, you get a grid superimposed over it, and a slider at the bottom that rotates the image. As you rotate the image, the grid stays in place as a reference.

Picasa by default doesn't actually modify your images, but remembers the transformations that you have applied. If you need to update the file you can (optionally) Save the changes within Picasa, and it will create a backup of your original in a hidden folder.


Imagemagick can handle batch processing, including rotation. Of course you'll need to know which image needs what amount (1-5 degrees) of rotation. You could either rotate all by 1 degree and then review for a further one degree, or check all at the start and put in folders of rotation amount.

-rotate degrees{<}{>} Apply Paeth image rotation (using shear operations) to the image.

Use > to rotate the image only if its width exceeds the height. < rotates the image only if its width is less than the height. For example, if you specify -rotate "-90>" and the image size is 480x640, the image is not rotated. However, if the image is 640x480, it is rotated by -90 degrees. If you use > or <, enclose it in quotation marks to prevent it from being misinterpreted as a file redirection.