Files
sirh/venv/lib/python3.12/site-packages/PIL/__pycache__/JpegPresets.cpython-312.pyc

72 lines
7.9 KiB
Plaintext
Raw Normal View History

2026-04-29 11:52:03 +02:00
<EFBFBD>
<00><><EFBFBD>i[0<00> <01><><00>dZddlmZdgd<04>gd<05>gd<06>dgd<07>gd<08>gd<06>dgd <09>gd
<EFBFBD>gd<06>dgd <0B>gd <0C>gd<06>dgd <0A>gd<0E>gd<06>dgd<0F>gd<10>gd<06>dgd<11>gd<12>gd<06>dgd<13>gd<14>gd<06>dgd <0B>gd<15>gd<06>d<16> Zy)u
JPEG quality settings equivalent to the Photoshop settings.
Can be used when saving JPEG files.
The following presets are available by default:
``web_low``, ``web_medium``, ``web_high``, ``web_very_high``, ``web_maximum``,
``low``, ``medium``, ``high``, ``maximum``.
More presets can be added to the :py:data:`presets` dict if needed.
To apply the preset, specify::
quality="preset_name"
To apply only the quantization table::
qtables="preset_name"
To apply only the subsampling setting::
subsampling="preset_name"
Example::
im.save("image_name.jpg", quality="web_high")
Subsampling
-----------
Subsampling is the practice of encoding images by implementing less resolution
for chroma information than for luma information.
(ref.: https://en.wikipedia.org/wiki/Chroma_subsampling)
Possible subsampling values are 0, 1 and 2 that correspond to 4:4:4, 4:2:2 and
4:2:0.
You can get the subsampling of a JPEG with the
:func:`.JpegImagePlugin.get_sampling` function.
In JPEG compressed data a JPEG marker is used instead of an EXIF tag.
(ref.: https://exiv2.org/tags.html)
Quantization tables
-------------------
They are values use by the DCT (Discrete cosine transform) to remove
*unnecessary* information from the image (the lossy part of the compression).
(ref.: https://en.wikipedia.org/wiki/Quantization_matrix#Quantization_matrices,
https://en.wikipedia.org/wiki/JPEG#Quantization)
You can get the quantization tables of a JPEG with::
im.quantization
This will return a dict with a number of lists. You can pass this dict
directly as the qtables argument when saving a JPEG.
The quantization table format in presets is a list with sublists. These formats
are interchangeable.
Libjpeg ref.:
https://web.archive.org/web/20120328125543/http://www.jpegcameras.com/libjpeg/libjpeg-3.html
<EFBFBD>)<01> annotations<6E>)@<40><00><00><00>'<00>2<00>.<00>><00>Dr<00><00><00>&r<00>5<00>Ar rr<00>rrrr r rrrrrr r r r rrrr r r r r
rrr r r r r r rr r r r r r r r r r r r r r )@<40>r<00> r<00>6r r r r<00><00>rrr r r rrr<00>+<00>Br r r rrrrr r r r rrrr r r r r r r r r r r r r r r r r r r r r r r r r r r r r )<02> subsampling<6E> quantization)@r<00> rrr<00>r<00>r<00> r<00>rrrrrr<00> rr<00><00>#<00>/rr rrr"<00>%r$<00>@rrrr"r<00>3r&r&rrr"r%r'r&r&r&rrr#r$r&r&r&r&rrr$r&r&r&r&r&)@<40>r r(rrr"r<00>0r <00>r r(rr"r#rr(r r<00>r"rr
rrr(r+rrrrr&rrr"rrr)r&r&r"r"rrr)<00>?r&r&rr#r
rr&r&r&r&r)rrr&r&r&r&r&)@<40><00>r.r-<00> rrrr.<00>r0r-<00><00>
rrr.r0r0r-r2r<00>r*r-r-r-rrr r*rr/r1r2rrrrrrr2rr rrrrrrr3r*rrrrrrr*rrrrr)@<40>r4r!rr"rrrr4rrrrrrrr!rr(rrrrrrrrrrrrrr"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)@rrrr<00>r.r0r-rrrrr5r.r0r-rrrrr.r0r4r/rrrr.r0r4r/rr5r5r.r0r1r2rrr.r.r0r4r2rrrr0r0r4r/rrrrr-r-r/rrrrr)@r5r5r0r/r!r r r r5r.r-rr3rrrr0r-r/r3rrrrr/rr3rrrrrr!r3rrrrrrr rrrrrrrr rrrrrrrr rrrrrrr)@<40>r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6rr6r6r6r6r6r6rrr6r6r6r6r6rrr5r6r6r6r6rrr5r5r6r6r6rrr5r5r5r6r6rrr5r5r5r5)@r6r6r6rrr5r5r5r6r6r6rr5r5r5r5r6r6r6r5r5r5r5r5rrr5r5r5r5r5r5rr5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5)@r r3r3rrr#<00>"r(r3rrr*r"rrrr3rr(rrrrrrr*rrrrrrrr"rrrrrrr#rrrrrrrr7rrrrrrrr(rrrrrrr)@rr*r+rrrr(r(r*rrr3r3rrrr+rr3r3rrrrrr3r3rrrrrrr3rrrrrrrrrrrrrrr(rrrrrrrr(rrrrrrr)@rr1r1rr(rrr(r1r/r/rr r*rrr1r/r2rr*rrrrrrrrrrrr(r r*rrrrrrr*rrrrrrrrrrrrrrr(rrrrrrr)@r!rr!rrrr(r(rr3r3r3r3rrrr!r3r3r3rrrrrr3r3rrrrrrr3rrrrrrrrrrrrrrr(rrrrrrrr(rrrrrrr)@r-r.r.r-r/rrrr.r0r0r-r1r2rrr.r0r0r-r2rrrr-r-r-rrrrrr/r1r2rrrrrrr2rrrrrrrrrrrrrrrrrrrrrr)@r4r4r!rrrr(r(r4rrr3r3rrrr!rr3r3rrrrrr3r3rrrrrrr3rrrrrrrrrrrrrrr(rrrrrrrr(rrrrrrr)@r5r5r0r/r!r r r r5r.r-r2r3rrrr0r-r/r3rrrrr/r2r3rrrrrr!r3rrrrrrr rrrrrrrr rrrrrrrr rrr
web_medium<EFBFBD>web_high<67> web_very_high<67> web_maximum<75>low<6F>medium<75>high<67>maximumN)<04>__doc__<5F>
__future__r<00>presets<74><00><00>L/home/fatima/modif/sirh/venv/lib/python3.12/site-packages/PIL/JpegPresets.py<70><module>rGs <00><01>?<04>B#<23>./<2F> @<01> @<01>. <20>!<21>&./<2F> @<01> @<01>.<1F> <20>&./<2F> @<01> @<01>.<1F> <20>&/0<> @<01> @<01>/ <20>!<21>&./<2F>!@<01>!@<01>.<1F> <20>&./<2F> @<01> @<01>.<1F> <20>&./<2F> @<01> @<01>.<1F> <20>&./<2F> @<01> @<01>.<1F> <20>&./<2F> @<01> @<01>.<1F> <20>sl <02>rE