Bens link above tells you how to create a Photoshop action to automate it. For those not used to Photoshops actions and batch processing try this tutorial
http://photoshop911.typepad.com/help...arking_ph.html
Just experiment with the settings first before recording and write down what you find the best so when you record the action you can go straight to the settings you chose earlier, means you only have to record it once and don't have to edit the action later.