From 858135beb59784166e76adedcdbc63734c25d82e Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Tue, 22 Nov 2022 14:52:12 +0100 Subject: [PATCH] Update image-file-formats.rst --- docs/handbook/image-file-formats.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index f70e25fb4..4e72faa66 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -200,7 +200,9 @@ Saving ~~~~~~ When calling :py:meth:`~PIL.Image.Image.save` to write a GIF file, the -following options are available:: +following options are available: + +.. code-block:: python im.save(out, save_all=True, append_images=[im1, im2, ...]) @@ -883,7 +885,9 @@ The :py:meth:`~PIL.Image.open` method sets the following attributes: Set to the number of images in the stack. A convenience method, :py:meth:`~PIL.SpiderImagePlugin.SpiderImageFile.convert2byte`, -is provided for converting floating point data to byte data (mode ``L``):: +is provided for converting floating point data to byte data (mode ``L``): + +.. code-block:: python im = Image.open("image001.spi").convert2byte() @@ -893,7 +897,9 @@ Saving ~~~~~~ The extension of SPIDER files may be any 3 alphanumeric characters. Therefore -the output format must be specified explicitly:: +the output format must be specified explicitly: + +.. code-block:: python im.save('newimage.spi', format='SPIDER')