From aca38b65043083c44e04dbd12074ce5ce89bbfbb Mon Sep 17 00:00:00 2001 From: Kylian Ronfleux--Corail <35237015+Kyliroco@users.noreply.github.com> Date: Mon, 14 Apr 2025 08:31:43 +0000 Subject: [PATCH] add more information on how qtables parameter works with quality --- docs/handbook/image-file-formats.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index bfa462c04..a557207f1 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -557,6 +557,8 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options: 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 qtables. + For more information on how qtables are modified based on the quality parameter, + see the qtables section. **optimize** If present and true, indicates that the encoder should make an extra pass @@ -621,6 +623,11 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options: * a list, tuple, or dictionary (with integer keys = range(len(keys))) of lists of 64 integers. There must be between 2 and 4 tables. + + If a quality parameter is provided, the qtables will be adjusted accordingly. + By default, the qtables are based on a standard JPEG table with a quality of 50. + The qtable values will be reduced if the quality is higher than 50 and increased + if the quality is lower than 50. .. versionadded:: 2.5.0