File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2475,7 +2475,21 @@ def save(
24752475 format to use is determined from the filename extension.
24762476 If a file object was used instead of a filename, this
24772477 parameter should always be used.
2478- :param params: Extra parameters to the image writer.
2478+ :param params: Extra parameters to the image writer. These can also be
2479+ set on the image itself through ``encoderinfo``. This is useful when
2480+ saving multiple images::
2481+
2482+ # Saving XMP data to a single image
2483+ from PIL import Image
2484+ red = Image.new("RGB", (1, 1), "#f00")
2485+ red.save("out.mpo", xmp=b"test")
2486+
2487+ # Saving XMP data to the second frame of an image
2488+ from PIL import Image
2489+ black = Image.new("RGB", (1, 1))
2490+ red = Image.new("RGB", (1, 1), "#f00")
2491+ red.encoderinfo = {"xmp": b"test"}
2492+ black.save("out.mpo", save_all=True, append_images=[red])
24792493 :returns: None
24802494 :exception ValueError: If the output format could not be determined
24812495 from the file name. Use the format option to solve this.
You can’t perform that action at this time.
0 commit comments