CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
JpegPresets.cpython-310.pyc71 linesDownload Raw Back to __pycache__
1o

2��YiM1�@s�dZddlmZdgd�gd�gd�dgd�gd�gd�dgd	�gd3�gd�dgd�gd�gd�dgd
�gd�gd�dgd�gd�gd�dgd�gd�gd�dgd�gd�gd�dgd�gd�gd�d�	ZdS)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�Arrr
�rrrrrrrrrrr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rrrrrrrrrrr%rrrrrrrr%rrrrrrr)@rr.r.rr%rrr%r.r,r,rrr'rrr.r,r/rr'rrrrrrrrrrrr%rr'rrrrrrr'rrrrrrrrrrrrrrr%rrrrrrr)@rrrrrrr%r%rr0r0r0r0rrrrr0r0r0rrrrrr0r0rrrrrrr0rrrrrrrrrrrrrrr%rrrrrrrr%rrrrrrr)@r*r+r+r*r,rrrr+r-r-r*r.r/rrr+r-r-r*r/rrrr*r*r*rrrrrr,r.r/rrrrrrr/rrrrrrrrrrrrrrrrrrrrrr)@r1r1rrrrr%r%r1rrr0r0rrrrrr0r0rrrrrr0r0rrrrrrr0rrrrrrrrrrrrrrr%rrrrrrrr%rrrrrrr)@r2r2r-r,rrrrr2r+r*r/r0rrrr-r*r,r0rrrrr,r/r0rrrrrrr0rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)	Zweb_lowZ69web_mediumZweb_highZ
web_very_highZweb_maximum�lowZmedium�high�maximumN)�__doc__�70__future__rZpresets�r:r:�yE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/JpegPresets.py�<module>sbA�������������������71
Aluode/PerceptionLabPortable · CoolFace