More JPEG documentation, fixes #890

This commit is contained in:
wiredfool 2014-09-24 16:30:39 -07:00
parent 798fe2d15f
commit cb166786df

View File

@ -117,20 +117,48 @@ converting ``RGB`` images to ``L``, and resize images to 1/2, 1/4 or 1/8 of
their original size while loading them. The :py:meth:`~PIL.Image.Image.draft` their original size while loading them. The :py:meth:`~PIL.Image.Image.draft`
method also configures the JPEG decoder to trade some quality for speed. method also configures the JPEG decoder to trade some quality for speed.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.Image.open` method may set the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties if available:
**jfif** **jfif**
JFIF application marker found. If the file is not a JFIF file, this key is JFIF application marker found. If the file is not a JFIF file, this key is
not present. not present.
**jfif_version**
A tuple representing the jfif version, (major version, minor version).
**jfif_density**
A tuple representing the pixel density of the image, in units specified
by jfif_unit.
**jfif_unit**
Units for the jfif_density:
* 0 - No Units
* 1 - Pixels per Inch
* 2 - Pixels per Centimeter
**dpi**
A tuple representing the reported pixel density in pixels per inch, if
the file is a jfif file and the units are in inches.
**adobe** **adobe**
Adobe application marker found. If the file is not an Adobe JPEG file, this Adobe application marker found. If the file is not an Adobe JPEG file, this
key is not present. key is not present.
**adobe_transform**
Vendor Specific Tag.
**progression** **progression**
Indicates that this is a progressive JPEG file. Indicates that this is a progressive JPEG file.
**icc-profile**
The ICC color profile for the image.
**exif**
Raw EXIF data from the image.
The :py:meth:`~PIL.Image.Image.save` method supports the following options: The :py:meth:`~PIL.Image.Image.save` method supports the following options:
**quality** **quality**
@ -147,6 +175,19 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
If present, indicates that this image should be stored as a progressive If present, indicates that this image should be stored as a progressive
JPEG file. JPEG file.
**dpi**
A tuple of integers representing the pixel density, ``(x,y)``.
**icc-profile**
If present, the image is stored with the provided ICC profile. If
this parameter is not provided, the image will be saved with no
profile attached. To preserve the existing profile::
im.save(filename, 'jpeg', icc_profile=im.info.get('icc_profile'))
**exif**
If present, the image will be stored with the provided raw EXIF data.
**subsampling** **subsampling**
If present, sets the subsampling for the encoder. If present, sets the subsampling for the encoder.
@ -670,7 +711,7 @@ files, using either JPEG or HEX encoding depending on the image mode (and
whether JPEG support is available or not). whether JPEG support is available or not).
PIXAR (read only) PIXAR (read only)
^^^^ ^^^^^^^^^^^^^^^^^
PIL provides limited support for PIXAR raster files. The library can identify PIL provides limited support for PIXAR raster files. The library can identify
and read “dumped” RGB files. and read “dumped” RGB files.