save method

save(self, filename)

Saves the image to a file.

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

save(self, filename, format)

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(self, stream, format)

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(self, filename, format, quality)

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(self, stream, format, quality)

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