mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
commit
a31e340998
12
PIL/Image.py
12
PIL/Image.py
|
@ -59,7 +59,7 @@ try:
|
||||||
# Note that other modules should not refer to _imaging directly;
|
# Note that other modules should not refer to _imaging directly;
|
||||||
# import Image and use the Image.core variable instead.
|
# import Image and use the Image.core variable instead.
|
||||||
# Also note that Image.core is not a publicly documented interface,
|
# Also note that Image.core is not a publicly documented interface,
|
||||||
# and should be considered private and subject to change.
|
# and should be considered private and subject to change.
|
||||||
from PIL import _imaging as core
|
from PIL import _imaging as core
|
||||||
if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
|
if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
|
||||||
raise ImportError("The _imaging extension was built for another "
|
raise ImportError("The _imaging extension was built for another "
|
||||||
|
@ -744,7 +744,7 @@ class Image:
|
||||||
associated with the image.
|
associated with the image.
|
||||||
|
|
||||||
:returns: An image access object.
|
:returns: An image access object.
|
||||||
:rtype: :ref:`PixelAccess` or :py:class:`PIL.PyAccess`
|
:rtype: :ref:`PixelAccess` or :py:class:`PIL.PyAccess`
|
||||||
"""
|
"""
|
||||||
if self.im and self.palette and self.palette.dirty:
|
if self.im and self.palette and self.palette.dirty:
|
||||||
# realize palette
|
# realize palette
|
||||||
|
@ -942,14 +942,14 @@ class Image:
|
||||||
"""
|
"""
|
||||||
Convert the image to 'P' mode with the specified number
|
Convert the image to 'P' mode with the specified number
|
||||||
of colors.
|
of colors.
|
||||||
|
|
||||||
:param colors: The desired number of colors, <= 256
|
:param colors: The desired number of colors, <= 256
|
||||||
:param method: 0 = median cut
|
:param method: 0 = median cut
|
||||||
1 = maximum coverage
|
1 = maximum coverage
|
||||||
2 = fast octree
|
2 = fast octree
|
||||||
:param kmeans: Integer
|
:param kmeans: Integer
|
||||||
:param palette: Quantize to the :py:class:`PIL.ImagingPalette` palette.
|
:param palette: Quantize to the :py:class:`PIL.ImagingPalette` palette.
|
||||||
:returns: A new image
|
:returns: A new image
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -1752,7 +1752,7 @@ class Image:
|
||||||
"""
|
"""
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def thumbnail(self, size, resample=LANCZOS):
|
def thumbnail(self, size, resample=BICUBIC):
|
||||||
"""
|
"""
|
||||||
Make this image into a thumbnail. This method modifies the
|
Make this image into a thumbnail. This method modifies the
|
||||||
image to contain a thumbnail version of itself, no larger than
|
image to contain a thumbnail version of itself, no larger than
|
||||||
|
@ -1770,7 +1770,7 @@ class Image:
|
||||||
:param resample: Optional resampling filter. This can be one
|
:param resample: Optional resampling filter. This can be one
|
||||||
of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`,
|
of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`,
|
||||||
:py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.LANCZOS`.
|
:py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.LANCZOS`.
|
||||||
If omitted, it defaults to :py:attr:`PIL.Image.LANCZOS`.
|
If omitted, it defaults to :py:attr:`PIL.Image.BICUBIC`.
|
||||||
(was :py:attr:`PIL.Image.NEAREST` prior to version 2.5.0)
|
(was :py:attr:`PIL.Image.NEAREST` prior to version 2.5.0)
|
||||||
:returns: None
|
:returns: None
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -355,7 +355,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
||||||
scale = s
|
scale = s
|
||||||
|
|
||||||
self.tile = [(d, e, o, a)]
|
self.tile = [(d, e, o, a)]
|
||||||
self.decoderconfig = (scale, 1)
|
self.decoderconfig = (scale, 0)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user