Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/PIL/__pycache__/JpegPresets.cpython-310.pyc

71 lines
7.8 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>f<EFBFBD>0<00> @s<>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> ZdS)uG
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://web.archive.org/web/20240227115053/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 rrrrr 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>rr r rrr<00> rr <00><00>#<00>/rrrr r!<00>%r#<00>@r rr r!r<00>3r%r%rr r!r$r&r%r%r%rr r"r#r%r%r%r%rrr#r%r%r%r%r%)@<40>rr'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>r/r,<00><00>
rrr-r/r/r,r1r<00>r)r,r,r,rrrr)rr.r0r1rrrrrrr1rrrrrrrrr2r)rrrrrrr)rrrrr)@<40>r3r rr!rrrr3rrrrrrrr rr'rrrrrrrrrrrrrr!rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)@rrrr<00>r-r/r,rrrrr4r-r/r,rrrrr-r/r3r.rrrr-r/r3r.rr4r4r-r/r0r1rrr-r-r/r3r1rrrr/r/r3r.rrrrr,r,r.rrrrr)@r4r4r/r.r rrrr4r-r,rr2rrrr/r,r.r2rrrrr.rr2rrrrrr r2rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)@<40>r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5rr5r5r5r5r5r5rrr5r5r5r5r5rrr4r5r5r5r5rrr4r4r5r5r5rrr4r4r4r5r5rrr4r4r4r4)@r5r5r5rrr4r4r4r5r5r5rr4r4r4r4r5r5r5r4r4r4r4r4rrr4r4r4r4r4r4rr4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4)@r r2r2rrr"<00>"r'r2rrr)r!r rrr2rr'rr rrrrr)rr rrrrrr!r rrrrrr"r rrrrrrr6rrrrrrrr'rrrrrrr)@rr)r*rrrr'r'r)rr r2r2rrrr*r r2r2rrrrrr2r2rrrrrrr2rrrrrrrrrrrrrrr'rrrrrrrr'rrrrrrr)@rr0r0rr'rrr'r0r.r.rrr)rrr0r.r1rr)rrrrrrrrrrrr'rr)rrrrrrr)rrrrrrrrrrrrrrr'rrrrrrr)@r rr rrrr'r'rr2r2r2r2rrrr r2r2r2rrrrrr2r2rrrrrrr2rrrrrrrrrrrrrrr'rrrrrrrr'rrrrrrr)@r,r-r-r,r.rrrr-r/r/r,r0r1rrr-r/r/r,r1rrrr,r,r,rrrrrr.r0r1rrrrrrr1rrrrrrrrrrrrrrrrrrrrrr)@r3r3r rrrr'r'r3rrr2r2rrrr rr2r2rrrrrr2r2rrrrrrr2rrrrrrrrrrrrrrr'rrrrrrrr'rrrrrrr)@r4r4r/r.r rrrr4r-r,r1r2rrrr/r,r.r2rrrrr.r1r2rrrrrr r2rrrrrrrrrrrrrrrrrrrrrrrrrr
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>rCrC<00>Q/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/PIL/JpegPresets.py<70><module>sb A<02><04><02><04><02><04><02><04><02><04><02><04><02><04><02><04><02><04><00>
<EFBFBD>