Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
JpegPresets.cpython-313.pyc72 linesDownload Raw Back to __pycache__
1�

2v�jM1����SrSSKJr S/SQ/SQ/S.S/SQ/SQ/S.S/S	Q/S3Q/S.S/SQ/SQ/S.S/S
Q/SQ/S.S/SQ/SQ/S.S/SQ/SQ/S.S/SQ/SQ/S.S/SQ/SQ/S.S.	rg)u4JPEG quality settings equivalent to the Photoshop settings.5Can be used when saving JPEG files.6 7The following presets are available by default:8``web_low``, ``web_medium``, ``web_high``, ``web_very_high``, ``web_maximum``,9``low``, ``medium``, ``high``, ``maximum``.10More presets can be added to the :py:data:`presets` dict if needed.11 12To apply the preset, specify::13 14  quality="preset_name"15 16To apply only the quantization table::17 18  qtables="preset_name"19 20To apply only the subsampling setting::21 22  subsampling="preset_name"23 24Example::25 26  im.save("image_name.jpg", quality="web_high")27 28Subsampling29-----------30 31Subsampling is the practice of encoding images by implementing less resolution32for chroma information than for luma information.33(ref.: https://en.wikipedia.org/wiki/Chroma_subsampling)34 35Possible subsampling values are 0, 1 and 2 that correspond to 4:4:4, 4:2:2 and364:2:0.37 38You can get the subsampling of a JPEG with the39:func:`.JpegImagePlugin.get_sampling` function.40 41In JPEG compressed data a JPEG marker is used instead of an EXIF tag.42(ref.: https://exiv2.org/tags.html)43 44 45Quantization tables46-------------------47 48They are values use by the DCT (Discrete cosine transform) to remove49*unnecessary* information from the image (the lossy part of the compression).50(ref.: https://en.wikipedia.org/wiki/Quantization_matrix#Quantization_matrices,51https://en.wikipedia.org/wiki/JPEG#Quantization)52 53You can get the quantization tables of a JPEG with::54 55  im.quantization56 57This will return a dict with a number of lists. You can pass this dict58directly as the qtables argument when saving a JPEG.59 60The quantization table format in presets is a list with sublists. These formats61are interchangeable.62 63Libjpeg ref.:64https://web.archive.org/web/20120328125543/http://www.jpegcameras.com/libjpeg/libjpeg-3.html65 66�)�annotations�)@����'�2�.�>�Dr���&r�5�Arrr�rrrrrrrrrrrrrr	rrrrrrrr67rrrrrrrrrrrrrrrrrrrrrrr)@�r� r�6rrrr��rrrrrrrr�+�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)�subsampling�quantization)@r�rrr�r�r�r�rrrrrr�
rr��#�/rr rrr"�%r$�@rrrr"r�3r&r&rrr"r%r'r&r&r&rrr#r$r&r&r&r&rrr$r&r&r&r&r&)@�r r(rrr"r�0r �r
r(rr"r#rr(r
r�r"rr68rrr(r+rrrrr&rrr"rrr)r&r&r"r"rrr)�?r&r&rr#r69rr&r&r&r&r)rrr&r&r&r&r&)@��r.r-�	rrrr.�r0r-��70rrr.r0r0r-r2r�r*r-r-r-rrr r*rr/r1r2rrrrrrr2rr rrrrrrr3r*rrrrrrr*rrrrr)@�r4r!rr"rrrr4rrrrrrrr!rr(rrrrrrrrrrrrrr"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)@rrrr�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)@�r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6rr6r6r6r6r6r6rrr6r6r6r6r6rrr5r6r6r6r6rrr5r5r6r6r6rrr5r5r5r6r6rrr5r5r5r5)@r6r6r6rrr5r5r5r6r6r6rr5r5r5r5r6r6r6r5r5r5r5r5rrr5r5r5r5r5r5rr5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5)@r
r3r3rrr#�"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 rrrrrrr)	�web_low�71web_medium�web_high�
web_very_high�web_maximum�low�medium�high�maximumN)�__doc__�72__future__r�presets���UD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/JpegPresets.py�<module>rGs��?�B#�./� @� @�. �!�&./� @� @�.� �&./� @� @�.� �&/0� @� @�/ �!�&./�!@�!@�.� �&./� @� @�.� �&./� @� @�.� �&./� @� @�.� �&./� @� @�.� �sl�rE
codekingpro/portable-devtools · Team Ai