From 38b9941d2d6f0528ce103aa58b9332fdf3151b56 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 15 Feb 2025 14:18:34 +1100 Subject: [PATCH] Sort formats alphabetically --- docs/handbook/image-file-formats.rst | 160 +++++++++++++-------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 69fb7f3b0..f9a751ff9 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -24,6 +24,86 @@ present, and the :py:attr:`~PIL.Image.Image.format` attribute will be ``None``. Fully supported formats ----------------------- +AVIF +^^^^ + +Pillow reads and writes AVIF files, including AVIF sequence images. Currently, +it is only possible to save 8-bit AVIF images, and all AVIF images are decoded +as 8-bit RGB(A). + +The :py:meth:`~PIL.Image.Image.save` method supports the following options: + +**quality** + Integer, 0-100, defaults to 75. 0 gives the smallest size and poorest + quality, 100 the largest and best quality. + +**subsampling** + If present, sets the subsampling for the encoder. Defaults to ``4:2:0``. + Options include: + + * ``4:0:0`` + * ``4:2:0`` + * ``4:2:2`` + * ``4:4:4`` + +**speed** + Quality/speed trade-off (0=slower-better, 10=fastest). Defaults to 6. + +**max_threads** + Limit the number of active threads used. By default, there is no limit. If the aom + codec is used, there is a maximum of 64. + +**range** + YUV range, either "full" or "limited". Defaults to "full" + +**codec** + AV1 codec to use for encoding. Specific values are "aom", "rav1e", and + "svt", presuming the chosen codec is available. Defaults to "auto", which + will choose the first available codec in the order of the preceding list. + +**tile_rows** / **tile_cols** + For tile encoding, the (log 2) number of tile rows and columns to use. + Valid values are 0-6, default 0. Ignored if "autotiling" is set to true in libavif + version **0.11.0** or greater. + +**autotiling** + Split the image up to allow parallelization. Enabled automatically if "tile_rows" + and "tile_cols" both have their default values of zero. Requires libavif version + **0.11.0** or greater. + +**alpha_premultiplied** + Encode the image with premultiplied alpha. Defaults to ``False``. Requires libavif + version **0.9.0** or greater. + +**advanced** + Codec specific options. Requires libavif version **0.8.2** or greater. + +**icc_profile** + The ICC Profile to include in the saved file. + +**exif** + The exif data to include in the saved file. + +**xmp** + The XMP data to include in the saved file. + +Saving sequences +~~~~~~~~~~~~~~~~ + +When calling :py:meth:`~PIL.Image.Image.save` to write an AVIF file, by default +only the first frame of a multiframe image will be saved. If the ``save_all`` +argument is present and true, then all frames will be saved, and the following +options will also be available. + +**append_images** + A list of images to append as additional frames. Each of the + images in the list can be single or multiframe images. + +**duration** + The display duration of each frame, in milliseconds. Pass a single + integer for a constant duration, or a list or tuple to set the + duration for each frame separately. + BLP ^^^ @@ -1349,86 +1429,6 @@ XBM Pillow reads and writes X bitmap files (mode ``1``). -AVIF -^^^^ - -Pillow reads and writes AVIF files, including AVIF sequence images. Currently, -it is only possible to save 8-bit AVIF images, and all AVIF images are decoded -as 8-bit RGB(A). - -The :py:meth:`~PIL.Image.Image.save` method supports the following options: - -**quality** - Integer, 0-100, defaults to 75. 0 gives the smallest size and poorest - quality, 100 the largest and best quality. - -**subsampling** - If present, sets the subsampling for the encoder. Defaults to ``4:2:0``. - Options include: - - * ``4:0:0`` - * ``4:2:0`` - * ``4:2:2`` - * ``4:4:4`` - -**speed** - Quality/speed trade-off (0=slower-better, 10=fastest). Defaults to 6. - -**max_threads** - Limit the number of active threads used. By default, there is no limit. If the aom - codec is used, there is a maximum of 64. - -**range** - YUV range, either "full" or "limited". Defaults to "full" - -**codec** - AV1 codec to use for encoding. Specific values are "aom", "rav1e", and - "svt", presuming the chosen codec is available. Defaults to "auto", which - will choose the first available codec in the order of the preceding list. - -**tile_rows** / **tile_cols** - For tile encoding, the (log 2) number of tile rows and columns to use. - Valid values are 0-6, default 0. Ignored if "autotiling" is set to true in libavif - version **0.11.0** or greater. - -**autotiling** - Split the image up to allow parallelization. Enabled automatically if "tile_rows" - and "tile_cols" both have their default values of zero. Requires libavif version - **0.11.0** or greater. - -**alpha_premultiplied** - Encode the image with premultiplied alpha. Defaults to ``False``. Requires libavif - version **0.9.0** or greater. - -**advanced** - Codec specific options. Requires libavif version **0.8.2** or greater. - -**icc_profile** - The ICC Profile to include in the saved file. - -**exif** - The exif data to include in the saved file. - -**xmp** - The XMP data to include in the saved file. - -Saving sequences -~~~~~~~~~~~~~~~~ - -When calling :py:meth:`~PIL.Image.Image.save` to write an AVIF file, by default -only the first frame of a multiframe image will be saved. If the ``save_all`` -argument is present and true, then all frames will be saved, and the following -options will also be available. - -**append_images** - A list of images to append as additional frames. Each of the - images in the list can be single or multiframe images. - -**duration** - The display duration of each frame, in milliseconds. Pass a single - integer for a constant duration, or a list or tuple to set the - duration for each frame separately. - Read-only formats -----------------