save method

save

Saves the image to a file.

def save(self, filename):
    ...
ParameterTypeDescription
filenamestrThe path to the file where the image will be saved.

save

Saves the image to a file in the specified format.

def save(self, filename, format):
    ...
ParameterTypeDescription
filenamestrThe path to the file where the image will be saved.
formatImageFormatThe image format.

save

Saves the image to a stream in the specified format.

def save(self, stream, format):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream where the image will be saved.
formatImageFormatThe image format.

save

Saves the image to a file in the specified format and quality.

def save(self, filename, format, quality):
    ...
ParameterTypeDescription
filenamestrThe path to the file where the image will be saved.
formatImageFormatThe image format.
qualityintThe quality of the saved image (0 to 100).

This parameter only affects saving in ImageFormat.JPEG; for all other formats, it is ignored.

save

Saves the image to a stream in the specified format and quality.

def save(self, stream, format, quality):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream where the image will be saved.
formatImageFormatThe image format.
qualityintThe quality of the saved image (0 to 100).

This parameter only affects saving in ImageFormat.JPEG; for all other formats, it is ignored.

See Also