bmp_file = 'foo.bmp'
jpg_file = 'foo.jpg'
import google.appengine.api.images
with open(bmp_file, 'rb') as bmp_fd:
image = google.appengine.api.images.Image(bmp_file.read())
with open(jpg_file, 'wb') as jpg_fd:
jpg_fd.write(image.execute_transforms(output_encoding=google.appengine.api.images.JPEG))