ImageMagic is the tool of choice when you have to manipulate images on the command line.

 

You can easily install it from a shell with the following command:

Change all images in the current folder to a with of 800 pixels with a quality of 80%:

Convert a *.gif image to a *.jpg image