Save to file

You can specify the file type when you come to save

    image1.save("C:/MyDirectory/myimage.jpg"), quality=95)

Output as a byte array

import io
from PIL import Image

    image1_byte_array = io.BytesIO()
    image1.save(image1_byte_array, format='JPG')
    image1_byte_array = image1_byte_array.getvalue()
    return image1_byte_array

#You could then save this byte array toi a file using:
    with open("C:/MyDirectory/myimage.jpg"), "wb") as file1:
        file1.write(image1_byte_array)