def bmp2jpg(origin_img): img = Image.open(origin_img) convert_img = origin_img[:-4] + '.jpg' img.save(convert_img)