ó <×ï[cC@sƒdZi idd6ddddddd d dd d d d ddd dd dd ddd d dd d ddd d d dd ddd d d d dddd d d d d d dd d d d d d d d d d d d d d g@dddd dd d d dddd dd d d dddddd d d d d ddd d d d dddd d d d d d d d d d d d d d d d d d d d d d d d d d d d d g@gd6d6idd6ddddd ddddddddd d dddddd d d!d"dddd d d#d"d$d dd d dd%d$d$dd d d#d%d$d$d$dd d!d"d$d$d$d$ddd"d$d$d$d$d$g@d&dd&ddd d d'dd(d d&dd d!dd&d dd)d ddddd&d)ddddd$ddd ddd'd$d$d d ddd'd*d$d$d d!ddd$d$d$d$d'ddd$d$d$d$d$g@gd6d+6id,d6d-d.d.d-d/dddd.d0d0d-d1d2ddd.d0d0d-d2dd3d(d-d-d-dddd(dd/d1d2ddddddd2ddddddddd3d(ddddddd(dddddg@d4d4ddd dddd4dddddddddd&dddddddddddddd dddddddddddddddddddddddddddddddg@gd6d56id,d6ddddd6d.d0d-ddddd6d.d0d-ddddd.d0d4d/dddd.d0d4d/dd6d6d.d0d1d2ddd.d.d0d4d2dddd0d0d4d/ddddd-d-d/dddddg@d6d6d0d/ddddd6d.d-dd3dddd0d-d/d3ddddd/dd3ddddddd3ddddddddddddddddddddddddddddddg@gd6d76id,d6d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8dd8d8d8d8d8d8ddd8d8d8d8d8ddd6d8d8d8d8ddd6d6d8d8d8ddd6d6d6d8d8ddd6d6d6d6g@d8d8d8ddd6d6d6d8d8d8dd6d6d6d6d8d8d8d6d6d6d6d6ddd6d6d6d6d6d6dd6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6g@gd6d96idd6d d3d3ddd!d:d&d3ddd(d d ddd3dd&dd ddddd(dd dddddd d dddddd!d ddddddd:dddddddd&dddddddg@dd(d)dddd&d&d(dd d3d3dddd)d d3d3dddddd3d3ddddddd3ddddddddddddddd&dddddddd&dddddddg@gd6d;6idd6dd1d1dd&ddd&d1d/d/ddd(ddd1d/d2dd(dddddddddddd&dd(ddddddd(ddddddddddddddd&dddddddg@ddddddd&d&dd3d3d3d3ddddd3d3d3dddddd3d3ddddddd3ddddddddddddddd&dddddddd&dddddddg@gd6d<6id,d6d-d.d.d-d/dddd.d0d0d-d1d2ddd.d0d0d-d2dddd-d-d-dddddd/d1d2ddddddd2ddddddddddddddddddddddg@d4d4ddddd&d&d4ddd3d3dddddd3d3dddddd3d3ddddddd3ddddddddddddddd&dddddddd&dddddddg@gd6d=6id,d6ddddd6d.d0d-ddddd6d.d0d-ddddd.d0d4d/dddd.d0d4d/dd6d6d.d0d1d2ddd.d.d0d4d2dddd0d0d4d/ddddd-d-d/dddddg@d6d6d0d/ddddd6d.d-d2d3dddd0d-d/d3ddddd/d2d3ddddddd3ddddddddddddddddddddddddddddddg@gd6d>6Zd?S(@si JPEG quality settings equivalent to the Photoshop settings. More presets can be added to the presets dict if needed. Can be use when saving JPEG file. 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 `JpegImagePlugin.get_subsampling(im)` function. 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 arrays. You can pass this dict directly as the qtables argument when saving a JPEG. The tables format between im.quantization and quantization in presets differ in 3 ways: 1. The base container of the preset is a list with sublists instead of dict. dict[0] -> list[0], dict[1] -> list[1], ... 2. Each table in a preset is a list instead of an array. 3. The zigzag order is remove in the preset (needed by libjpeg >= 6a). You can convert the dict format to the preset format with the `JpegImagePlugin.convert_dict_qtables(dict_qtables)` function. Libjpeg ref.: https://web.archive.org/web/20120328125543/http://www.jpegcameras.com/libjpeg/libjpeg-3.html it subsamplingiiii'i2i.i>iDiii&i5iAiii i6iii+iBt quantizationtweb_lowi iii ii ii#i/i%i@i3ii0iii?t web_mediumiiii iii iitweb_highit web_very_highit web_maximumi"tlowtmediumthightmaximumN(t__doc__tpresets(((s//tmp/pip-build-SKekGm/pillow/PIL/JpegPresets.pytCs4 & & & & & & & &