in reply to image clean up and alignment

You might try PDL::Image2D or Tk::PhotoRotate. They both claim to rotate images by arbitrary angles. The PDL module can also crop regions of your image.

I think you'll find that PDL is a good thing to learn for your application. Many of its routines are based on fast C libraries. PDL is intended for the type of work that you are doing.

It should work perfectly the first time! - toma