This file is indexed.

/usr/share/doc/python-willow/html/_sources/guide/save.rst.txt is in python-willow-doc 1.1-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Saving images
=============

In Willow there are separate save operations for each image format:

 - :meth:`~Image.save_as_jpeg`
 - :meth:`~Image.save_as_png`
 - :meth:`~Image.save_as_gif`

All three take one positional argument, the file-like object to write the image
data to.

For example, to save an image as a PNG file:

.. code-block:: python

    with open('out.png', 'wb') as f:
        i.save_as_png(f)

Changing the JPEG quality setting
---------------------------------

:meth:`~Image.save_as_jpeg` takes a ``quality`` keyword argument, which is a
number between 1 and 100 which defaults to 85. Decreasing this number will
decrease the output file size at the cost of losing image quality.

For example, to save an image with low quality:

.. code-block:: python

    with open('low_quality.jpg', 'wb') as f:
        i.save_as_jpeg(f, quality=40)

Progressive JPEGs
-----------------

By default, JPEG's are saved in the same format as their source file but you
can force Willow to always save a "progressive" JPEG file by setting the
``progressive`` keyword argument to ``True``:

.. code-block:: python

    with open('progressive.jpg', 'wb') as f:
        i.save_as_jpeg(f, progressive=True)

Image optimisation
------------------

:meth:`~Image.save_as_jpeg` and :meth:`~Image.save_as_png` both take an
``optimize`` keyword that when set to true, will output an optimized image.

.. code-block:: python

    with open('optimized.jpg', 'wb') as f:
        i.save_as_jpeg(f, optimize=True)

This feature is currently only supported in the Pillow backend, if you use Wand
this argument will be ignored.