From 0c4f11a603a780231c12d5cdc8f8b6cf135b70fd Mon Sep 17 00:00:00 2001 From: David Miguel Susano Pinto Date: Mon, 14 Mar 2022 17:01:03 +0000 Subject: [PATCH 1/3] doc: document "keep" for JPEG save quality option. --- docs/handbook/image-file-formats.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 17808dbc4..d5a898150 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -364,10 +364,13 @@ The :py:meth:`~PIL.Image.open` method may set the following The :py:meth:`~PIL.Image.Image.save` method supports the following options: **quality** - The image quality, on a scale from 0 (worst) to 95 (best). The default is - 75. Values above 95 should be avoided; 100 disables portions of the JPEG - compression algorithm, and results in large files with hardly any gain in - image quality. + + The image quality, on a scale from 0 (worst) to 95 (best), or the string + `"keep"`. The default is 75. Values above 95 should be avoided; 100 disables + portions of the JPEG compression algorithm, and results in large files with + hardly any gain in image quality. The value `"keep"` is only valid for JPEG + files and will retain the original image quality level, subsampling, and + quantization tables. **optimize** If present and true, indicates that the encoder should make an extra pass From 1acc32d1d91c4fe3c49942f315464a5804fd4ce4 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Tue, 22 Mar 2022 22:34:04 +1100 Subject: [PATCH 2/3] Updated syntax --- docs/handbook/image-file-formats.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index d5a898150..2f7eaa6ed 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -364,11 +364,10 @@ The :py:meth:`~PIL.Image.open` method may set the following The :py:meth:`~PIL.Image.Image.save` method supports the following options: **quality** - The image quality, on a scale from 0 (worst) to 95 (best), or the string - `"keep"`. The default is 75. Values above 95 should be avoided; 100 disables + ``keep``. The default is 75. Values above 95 should be avoided; 100 disables portions of the JPEG compression algorithm, and results in large files with - hardly any gain in image quality. The value `"keep"` is only valid for JPEG + hardly any gain in image quality. The value ``keep`` is only valid for JPEG files and will retain the original image quality level, subsampling, and quantization tables. From 55852d53925214809c71a4bc99dfac8f5e9356db Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Sat, 26 Mar 2022 13:44:27 +1100 Subject: [PATCH 3/3] Use consistent term --- docs/handbook/image-file-formats.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 2f7eaa6ed..849c7ddf7 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -369,7 +369,7 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options: portions of the JPEG compression algorithm, and results in large files with hardly any gain in image quality. The value ``keep`` is only valid for JPEG files and will retain the original image quality level, subsampling, and - quantization tables. + qtables. **optimize** If present and true, indicates that the encoder should make an extra pass