in reply to Convert BMP to JPG?
Do you really have to write a script?
If you dont and want to do it the 'lazy' way use 'bmptoppm' to 'ppmtojpeg'