Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/PIL/__pycache__/Image.cpython-37.pyc

1269 lines
86 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
(U<>]s<><00>@s8ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl m
Z
m Z m Z m Z mZddlmZmZddlmZmZmZmZy ddlZWn ek
r<EFBFBD>ddlZeZYnXyddlmZmZWn$ek
r<EFBFBD>ddlmZmZYnXe
s<EFBFBD>t<1E>e<02>e <20>Z!Gdd<08>de"<22>Z#Gd d
<EFBFBD>d
e$<24>Z%Gd d <0C>d e&<26>Z'e(d <0A>Z)y:ddl m*Z+e e,e+dd<01>k<03>rvede,e+dd<01>e f<00><01>Wn<>ek
<EFBFBD>rZ-z<>e'<27>Z+e.e-<2D><01>/d<11><01>r<>e<08>0de"<22>nXe.e-<2D><01>/d<13><01>r<>e<08>0e.e-<2D>e"<22>n6de.e-<2D>k<06>r<>e<08>0de"<22>nde.e-<2D>k<06>re<08>0de"<22><00>WddZ-[-XYnXe1ed<18>Z2y ddl3Z3Wnek
<EFBFBD>rLdZ3YnXyddl4m5Z5dZ6WnFek
<EFBFBD>r<>yddl7m5Z5dZ6Wnek
<EFBFBD>r<>dZ6YnXYnXdd<1D>Z8dZ9dZ:dZ;dZ<dZ=d Z>d!Z?d"Z@dZAdZBdZCdZDd ZEdZFZ9d ZGdZHZId!ZJdZKZLdZMZNdZFZ9dZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYdZZe1e+d#<23><02>rpe+j[Z[e+j\Z\e+j]Z]e+j^Z^e+j_Z_gZ`iZaiZbiZciZdiZeiZfiZgd$d%d&d'd(d)d*d+d,d-d.d/d0<64> Zhejid1k<02>r<>d2Zjnd3Zjd4d5d6ejd7dfejd8dfd5d9d:d:d:d9d9d9d;d<d;d=d>d=d?d@d?dAdBdAdC<64>ZkdDdE<64>Zlemeh<65>ZndFZodGdH<64>ZpdIdJ<64>ZqdKdL<64>ZrdMdN<64>ZsdatdOdP<64>ZudQdR<64>Zvd<76>dTdU<64>Zwd<77>dVdW<64>ZxdXdY<64>ZyGdZd[<5B>d[e&<26>Zzd\d]<5D>Z{Gd^d_<64>d_e&<26>Z|Gd`da<64>dae&<26>Z}Gdbdc<64>dce&<26>Z~ddde<64>Zdfdg<64>Z<>d<EFBFBD>dhdi<64>Z<>d<EFBFBD>dkdl<64>Z<>dmdn<64>Z<>d<EFBFBD>dodp<64>Z<>d<EFBFBD>dqdr<64>Z<>dsdt<64>Z<>dudv<64>Z<>dwdxdydzd{d|d}d~dd<7F>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>e<EFBFBD>d<EFBFBD>ejd7f<d<>e<EFBFBD>d<EFBFBD>ejd8f<d<>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD><64>Z<>d<EFBFBD>d<EFBFBD>d<EFBFBD><64>Z<>e<EFBFBD><65>e<00><>e+j<><6A>Gd<>d<EFBFBD><64>d<>e<1C>Z<>dS)<29><>N<>)<05>PILLOW_VERSION<4F> ImageMode<64>TiffTags<67> __version__<5F>_plugins)<02>i8<69>i32le)<04>deferred_error<6F>isPath<74> isStringType<70>py3)<02>Callable<6C>MutableMappingc@s eZdZdS)<02>DecompressionBombWarningN)<03>__name__<5F>
__module__<EFBFBD> __qualname__<5F>rr<00>-/tmp/pip-install-pc7tm5jb/Pillow/PIL/Image.pyrBsrc@s eZdZdS)<02>DecompressionBombErrorN)rrrrrrrrFsrc@seZdZdd<02>ZdS)<04>_imaging_not_installedcCs td<01><01>dS)Nz&The _imaging C module is not installed)<01> ImportError)<02>self<6C>idrrr<00> __getattr__Lsz"_imaging_not_installed.__getattr__N)rrrrrrrrrJsriUUU)<01>_imagingrzjThe _imaging extension was built for another version of Pillow or PIL:
Core version: %s
Pillow version: %szModule use of pythonz?The _imaging extension was built for another version of Python.zThe _imaging extensionz!Symbol not found: _PyUnicodeUCS2_zxThe _imaging extension was built for Python with UCS2 support; recompile Pillow or build Python --without-wide-unicode. z!Symbol not found: _PyUnicodeUCS4_zuThe _imaging extension was built for Python with UCS4 support; recompile Pillow or build Python --with-wide-unicode. <20>pypy_version_info)<01>PathTFcCs
t|d<01>S)z<>
Checks if an object is an image object.
.. warning::
This function is for internal use only.
:param t: object to check if it's an image
:returns: True if the object is an image
<20>im)<01>hasattr)<01>trrr<00> isImageType<70>s r"<00><00><00><00><00><00>DEFAULT_STRATEGY)<03>Lr))<01>1)r)r))r))r)<00>I)r+)r)<00>F)r,)<03>Pr))r-)<03>RGBr))<03>R<>G<>B)r.r))r/r0r1<00>X)r.r))r/r0r1<00>A)r.r))<04>C<>M<>Y<>K)r.r))r6ZCbZCr)r.r))r)r3r1)r.r))<03>H<>S<>V) r*r)r+r,r-r.<00>RGBX<42>RGBA<42>CMYK<59>YCbCr<43>LAB<41>HSV<53>little<6C><<3C>>)z|b1N)z|u1N)z|u1r#<00>i4Zf4)z|u1r$)z|u1r%)z<u2N)z>u2N)z<i2N)z>i2N)z<u4N)z>u4N)z<i4N)z>i4N)r*r)<00>LAr+r,r-r.r;r<r=r>r?r@zI;16zI;16BzI;16LzI;16SzI;16BSzI;16LSzI;32zI;32BzI;32LzI;32SzI;32BSzI;32LScCsLt|j\}}|dkr.|jd|jdf|fS|jd|jd|f|fSdS)Nrr)<03>
_MODE_CONV<EFBFBD>mode<64>size)r<00>typ<79>extrarrr<00>_conv_type_shape(srK)r)r-r;r<r=zI;16zI;16LzI;16BcCs t<00>|<00>jS)a%
Gets the "base" mode for given mode. This function returns "L" for
images that contain grayscale data, and "RGB" for images that
contain color data.
:param mode: Input mode.
:returns: "L" or "RGB".
:exception KeyError: If the input mode was not a standard mode.
)r<00>getmodeZbasemode)rGrrr<00> getmodebase7s
rMcCs t<00>|<00>jS)a 
Gets the storage type mode. Given a mode, this function returns a
single-layer mode suitable for storing individual bands.
:param mode: Input mode.
:returns: "L", "I", or "F".
:exception KeyError: If the input mode was not a standard mode.
)rrLZbasetype)rGrrr<00> getmodetypeDs rNcCs t<00>|<00>jS)a<>
Gets a list of individual band names. Given a mode, this function returns
a tuple containing the names of individual bands (use
:py:method:`~PIL.Image.getmodetype` to get the mode used to store each
individual band.
:param mode: Input mode.
:returns: A tuple containing band names. The length of the tuple
gives the number of bands in an image of the given mode.
:exception KeyError: If the input mode was not a standard mode.
)rrL<00>bands)rGrrr<00>getmodebandnamesPs rPcCstt<01>|<00>j<03>S)z<>
Gets the number of individual bands for this mode.
:param mode: Input mode.
:returns: The number of bands in this mode.
:exception KeyError: If the input mode was not a standard mode.
)<04>lenrrLrO)rGrrr<00> getmodebands_srRcCs<>tdkr dSyddlm}|s"t<03>Wntk
r8YnXyddlm}|sPt<03>Wntk
rfYnXyddlm}|s~t<03>Wntk
r<EFBFBD>YnXyddlm}|s<>t<03>Wntk
r<EFBFBD>YnXyddlm}|s<>t<03>Wntk
r<EFBFBD>YnXdadS)z-Explicitly load standard file format drivers.rN)<01>BmpImagePlugin)<01>GifImagePlugin)<01>JpegImagePlugin)<01>PpmImagePlugin)<01>PngImagePlugin) <09> _initialized<65>rS<00>AssertionErrorrrTrUrVrW)rSrTrUrVrWrrr<00>preinitps8          r[c Cs<>tdkr dSxdtD]\}y&t<02>d|<00>td|t<05>t<06>g<00>Wqtk
rl}zt<02>d||<01>Wdd}~XYqXqWtszt r<>dadSdS)zw
Explicitly initializes the Python Imaging Library. This function
loads all available file format drivers.
r#rz Importing %szPIL.%szImage: failed to import %s: %sNr)
rXr<00>logger<65>debug<75>
__import__<EFBFBD>globals<6C>localsr<00>OPEN<45>SAVE)Zplugin<69>errr<00>init<69>s
 $rdrcCs<>|dkrd}nt|t<01>s|f}yt|}||f||<00><02>Stk
rLYnXy tt|d<00>}||f||<00><02>Stk
r<EFBFBD>td|<00><01>YnXdS)Nr<00>_decoderzdecoder %s not available)<08>
isinstance<EFBFBD>tuple<6C>DECODERS<52>KeyError<6F>getattr<74>core<72>AttributeError<6F>IOError)rG<00> decoder_name<6D>argsrJ<00>decoderrrr<00> _getdecoder<65>s
rqcCs<>|dkrd}nt|t<01>s|f}yt|}||f||<00><02>Stk
rLYnXy tt|d<00>}||f||<00><02>Stk
r<EFBFBD>td|<00><01>YnXdS)Nr<00>_encoderzencoder %s not available)rfrg<00>ENCODERSrirjrkrlrm)rG<00> encoder_namerorJ<00>encoderrrr<00> _getencoder<65>s
rvcCst|t<01>r|St|<00>S)N)rf<00>_E)<01>valuerrr<00>coerce_e<5F>sryc@s$eZdZdd<02>Zdd<04>Zdd<06>ZdS)rwcCs
||_dS)N)<01>data)rrzrrr<00>__init__<5F>sz _E.__init__cCst|jdt|<01>jf<03>S)N<>__add__)rwrzry)r<00>otherrrrr|<00>sz
_E.__add__cCst|jdt|<01>jf<03>S)N<>__mul__)rwrzry)rr}rrrr~<00>sz
_E.__mul__N)rrrr{r|r~rrrrrw<00>srwcCs<>dg}|t|<01><01>j}yV|\}}}||krD|dkrDt|tj<04>rD|dfS||krh|dkrht|tj<04>rhd|fSWntk
r~YnXyL|\\}}}}}||kr<>|dkr<>t|tj<04>r<>|dkr<>t|tj<04>r<>||fSWntk
r<EFBFBD>YnXtd<06><01>dS)N<>stubr~gr|g<00>?zillegal expression)rwrzrf<00>numbers<72>Number<65> TypeError<6F>
ValueError)<08>exprrrz<00>a<>b<>c<>drcrrr<00>_getscaleoffset<65>s*
    r<>c@s<>eZdZdZdZdZdZdd<05>Zedd<07><00>Z edd <09><00>Z
ed
d <0B><00>Z d d <0A>Z dd<0F>Z dd<11>Zdd<13>Zejjdkrxdd<16>Zdd<18>Zdd<1A>Zd<>dd<1C>Zdd<1E>Zdd <20>Zd!d"<22>Zd#d$<24>Zed%d&<26><00>Zd'd(<28>Zd)d*<2A>Zd<>d,d-<2D>Zd.d/<2F>Zd<>d1d2<64>Z d<>d3d4<64>Z!d5d6<64>Z"d7d8<64>Z#d9d:<3A>Z$ddde%d;fd<d=<3D>Z&d<>d@dA<64>Z'dBdC<64>Z(e(Z)d<>dDdE<64>Z*dFdG<64>Z+dHdI<64>Z,d<>dJdK<64>Z-dLdM<64>Z.dNdO<64>Z/dPdQ<64>Z0d<30>dRdS<64>Z1d<31>dTdU<64>Z2dVdW<64>Z3dXdY<64>Z4dZd[<5B>Z5d\d]<5D>Z6d^d_<64>Z7d`da<64>Z8d<38>dbdc<64>Z9d<39>ddde<64>Z:d<>dfdg<64>Z;d<>dhdi<64>Z<d<>dkdl<64>Z=d<>dmdn<64>Z>dodp<64>Z?d<>dsdt<64>Z@d<>dvdw<64>ZAdxdy<64>ZBd<42>dzd{<7B>ZCeDdfd|d}<7D>ZEeDd>dddfd~d<64>ZFd<46>d<EFBFBD>d<EFBFBD><64>ZGd<47>d<EFBFBD><64>ZHd<48>d<EFBFBD>d<EFBFBD><64>ZId<49>d<EFBFBD><64>ZJd<4A>d<EFBFBD><64>ZKd<4B>d<EFBFBD><64>ZLeMfd<>d<EFBFBD><64>ZNdeDd?dfd<>d<EFBFBD><64>ZOeDd?fd<>d<EFBFBD><64>ZPd<50>d<EFBFBD><64>ZQd<51>d<EFBFBD><64>ZRd<52>d<EFBFBD><64>ZSd<53>d<EFBFBD><64>ZTdS)<29><>ImageaD
This class represents an image object. To create
:py:class:`~PIL.Image.Image` objects, use the appropriate factory
functions. There's hardly ever any reason to call the Image constructor
directly.
* :py:func:`~PIL.Image.open`
* :py:func:`~PIL.Image.new`
* :py:func:`~PIL.Image.frombytes`
NTcCs:d|_d|_d|_d|_i|_t|_d|_d|_d|_ dS)NrY)rrr)
rrG<00>_size<7A>palette<74>info<66>NORMAL<41>category<72>readonly<6C>pyaccess<73>_exif)rrrrr{#szImage.__init__cCs
|jdS)Nr)rH)rrrr<00>width0sz Image.widthcCs
|jdS)Nr)rH)rrrr<00>height4sz Image.heightcCs|jS)N)r<>)rrrrrH8sz
Image.sizecCs`t<00>}||_|j|_|j|_|jdkrP|jr:|j<05><06>|_nddlm}|<03><08>|_|j <09><06>|_ |S)N)r-<00>PAr)<01> ImagePalette)
r<EFBFBD>rrGrHr<>r<><00>copyrYr<>r<>)rr<00>newr<77>rrr<00>_new<s
 
 z
Image._newcCs|S)Nr)rrrr<00> __enter__LszImage.__enter__cGsBt|d<01>r8t|dd<03>r8t|d<04>r(|<00><02>|jr8|j<03><04>d|_dS)N<>fp<66> _exclusive_fpF<70>
_close__fp)r rjr<>r<><00>close)rrorrr<00>__exit__Os 

zImage.__exit__c
Cszy&t|d<01>r|<00><01>|j<02><03>d|_Wn.tk
rT}zt<05>d|<01>Wdd}~XYnXt|dd<02>rhd|_t t
d<05><01>|_ dS)a<>
Closes the file pointer, if possible.
This operation will destroy the image core and release its memory.
The image data will be unusable afterward.
This function is only required to close images that have not
had their file read and closed by the
:py:meth:`~PIL.Image.Image.load` method. See
:ref:`file-handling` for more information.
r<>NzError closing: %s<>mapzOperation on closed image) r r<>r<>r<><00> Exceptionr\r]rjr<>r
r<>r)r<00>msgrrrr<>Ws 


 z Image.closer$cCs |<00><00>dS)N)r<>)rrrr<00>__del__usz Image.__del__cCs$|<00><00>|j<01><02>|_d|_d|_dS)Nr)<05>loadrr<>r<>r<>)rrrr<00>_copyxs z Image._copycCs|jr|<00><01>n|<00><02>dS)N)r<>r<>r<>)rrrr<00>_ensure_mutable~s
zImage._ensure_mutablecKs<>ddl}d}|rd|}|s6|<04>|<05>\}}t<02>|<06>n|}|<07>|<05>sL||}|<00><05>|r`|dkrn|j<06>|<07>n|j||f|<03>|S)NrrY<00>.ZPPM) <09>tempfile<6C>mkstemp<6D>osr<73><00>endswithr<68>rZsave_ppm<70>save)r<00>file<6C>format<61>optionsr<73><00>suffix<69>f<>filenamerrr<00>_dump<6D>s 
 z Image._dumpcCsh|j|jkof|j|jkof|j|jkof|j|jkof|j|jkof|j|jkof|<00><06>|<01><06>kof|<00><07>|<01><07>kS)N)<08> __class__rGrHr<>r<>r<><00>
getpalette<EFBFBD>tobytes)rr}rrr<00>__eq__<5F>s      z Image.__eq__cCs||k}| S)Nr)rr}<00>eqrrr<00>__ne__<5F>sz Image.__ne__cCs.d|jj|jj|j|jd|jdt|<00>fS)Nz(<%s.%s image mode=%s size=%dx%d at 0x%X>rr)r<>rrrGrHr)rrrr<00>__repr__<5F>szImage.__repr__cCst<00><01>}|<00>|d<01>|<01><03>S)z[ iPython display hook support
:returns: png version of the image as bytes
ZPNG)<04>io<69>BytesIOr<4F><00>getvalue)rr<>rrr<00>
_repr_png_<EFBFBD>s zImage._repr_png_cCsTi}t|<00>\}}||d<||d<d|d<|jdkrD|<00>dd<07>|d<n |<00><02>|d<|S) N<>shape<70>typestrr$<00>versionr*<00>rawr)rz)rKrGr<>)rr<>r<>r<>rrr<00>__array_interface__<5F>s 
 zImage.__array_interface__cCs|j|j|j|<00><03>|<00><04>gS)N)r<>rGrHr<>r<>)rrrr<00> __getstate__<5F>szImage.__getstate__cCsbt<00>|<00>g|_|\}}}}}||_||_||_t<06>||<04>|_|dkrT|rT|<00> |<05>|<00>
|<06>dS)N)r)rEr-r<>) r<>r{Ztiler<65>rGr<>rkr<>r<00>
putpalette<EFBFBD> frombytes)r<00>stater<65>rGrHr<>rzrrr<00> __setstate__<5F>s
 
zImage.__setstate__r<5F>c Gs<>t|<02>dkr"t|dt<02>r"|d}|dkr8|dkr8|j}|<00><04>t|j||<02>}|<03>|j<07>td|j dd<00>}g}x$|<03>
|<04>\}}}|<05> |<08>|rtPqtW|dkr<>t d|<00><01>d<08> |<05>S) a<>
Return image as a bytes object.
.. warning::
This method returns the raw image data from the internal
storage. For compressed image data (e.g. PNG, JPEG) use
:meth:`~.save`, with a BytesIO parameter for in-memory
data.
:param encoder_name: What encoder to use. The default is to
use the standard "raw" encoder.
:param args: Extra arguments to the encoder.
:rtype: A bytes object.
rrr<>rir%zencoder error %d in tobytes<65>)rQrfrgrGr<>rv<00>setimager<00>maxrH<00>encode<64>append<6E> RuntimeError<6F>join) rrtrorc<00>bufsizerz<00>l<>sr<73>rrrr<><00>s" 
 z Image.tobytescOs td<01><01>dS)Nz;tostring() has been removed. Please call tobytes() instead.)<01>NotImplementedError)rro<00>kwrrr<00>tostring szImage.tostring<6E>imagecCsj|<00><00>|jdkrtd<02><01>|<00>d<03>}d<04>d||jdf<00>d<07>d||jd f<00>d<07>d
|<00>d<07>|d g<05>S) a-
Returns the image converted to an X11 bitmap.
.. note:: This method only works for mode "1" images.
:param name: The name prefix to use for the bitmap variables.
:returns: A string containing an X11 bitmap.
:raises ValueError: If the mode is not "1"
r*z not a bitmapZxbmr<6D>z#define %s_width %d
r<00>asciiz#define %s_height %d
rzstatic char %s_bits[] = {
s};)r<>rGr<>r<>r<>rHr<>)r<00>namerzrrr<00>tobitmaps 

 zImage.tobitmapcGs<>t|<03>dkr"t|dt<02>r"|d}|dkr8|dkr8|j}t|j||<03>}|<04>|j<06>|<04>|<01>}|ddkrptd<05><01>|ddkr<>td<06><01>dS)z<>
Loads this image with pixel data from a bytes object.
This method is similar to the :py:func:`~PIL.Image.frombytes` function,
but loads data into this image instead of creating a new image object.
rrr<>rznot enough image datazcannot decode image dataN) rQrfrgrGrqr<>r<00>decoder<65>)rrzrnror<>r<>rrrr<>'s  
  zImage.frombytescOs td<01><01>dS)Nz?fromstring() has been removed. Please call frombytes() instead.)r<>)rror<>rrr<00>
fromstringAszImage.fromstringcCs<>|jr<>|jr<>|jjr<>|jj|j<01><04><00>d|j_d|j_d|j_d|jkr<>t|jdt <09>rn|j<00>
|jdd<01>n|j<00> |jd<00>d|j_|jr<>t r<>t r<>|jr<>|jSddlm}|<01>||j<12>|_|jr<>|jS|j<00>|j<12>SdS)a<>
Allocates storage for the image and loads the pixel data. In
normal cases, you don't need to call this method, since the
Image class automatically loads an opened image when it is
accessed for the first time.
If the file associated with the image was opened by Pillow, then this
method will close it. The exception to this is if the image has
multiple frames, in which case the file will be left open for seek
operations. See :ref:`file-handling` for more information.
:returns: An image access object.
:rtype: :ref:`PixelAccess` or :py:class:`PIL.PyAccess`
rr.N<> transparencyr<r)<01>PyAccess)rr<>Zdirtyr<79><00>getdatarG<00>rawmoder<65>rf<00>int<6E>putpalettealpha<68>putpalettealphas<61>cffi<66>USE_CFFI_ACCESSr<53>rYr<>r<>r<>Z pixel_access)rr<>rrrr<>Fs&
 z
Image.loadcCsdS)as
Verifies the contents of a file. For data read from a file, this
method attempts to determine if the file is broken, without
actually decoding the image data. If this method finds any
problems, it raises suitable exceptions. If you need to load
the image after using this method, you must reopen the image
file.
Nr)rrrr<00>verifyms z Image.verify<66>c s>|<00><00>|s*|jdkr*|jr&|jj}nd}|r<||jkrD<72>sD|<00><03>S|j<04>d<03>dk }<06>r<>|dkrhtd<06><01>|j<07>|<01><01>}|<00> |<07>}|r<>|jj
dkr<>|jd<00>dd <09><00>|d
kr<><72><00><01><02><02>n0t |<01>dkr<>t <0C><00><01>fd d <0C>t d t <0B><02><01>D<00><01><01><02>|jd<|S|dk<02>r|jdk<02>r|<00>|<05>Sd} d}
|<06>r<>|jdk<06>r^|dk<02>r^|<00> |j<07>||jd<00><02>} | jd=| S|jdk<06>r<|dk<06>r<|jd} t| t<11><02>r<>t<12>d<12>d}
n<EFBFBD>t<14><00> t<15>|jd<14><02>} |jdk<02>r| <0A>|j<02>t| t <0C><02>ry| j<02>| <0C>} Wntk
<EFBFBD>rtd<15><01>YnX| <0A>d| <0C>|dk<06>r&| <0A>|<01>} n
| <0A>d<02>} | <0A>d<16>} nb|jdk<02>r<>|dk<02>r<>|jd} d}
t| t<11><02>rz|j<07>| <0C>n$t| t<1E><02>r<>|j<07>| d <0A>ntd<17><01>|dk<02>rF|t k<02>rF|j<07>|<05>}|<00> |<07>}ddl!m"}|<0E>#d|j<07>$d<02><01>|_|
<EFBFBD>r<>|jd=| dk <09>rBy|j<02>| <09>|jd<Wn(tk
<EFBFBD>r@|jd=t<12>d<1A>YnX|S|dk<08>rTt%}y|j<07>||<03>}WnXtk
<EFBFBD>r<>y"|j<07>t&|j<01><01>}|<07>||<03>}Wnt'k
<EFBFBD>r<>td<06><01>YnXYnX|<00> |<07>} |
<EFBFBD>r<>| jd=| dk <09>r:| jdk<02>r0y| j<02>| <09>| jd<Wn(tk
<EFBFBD>r,| jd=t<12>d<1A>YnXn
| | jd<| S)a<>
Returns a converted copy of this image. For the "P" mode, this
method translates pixels through the palette. If mode is
omitted, a mode is chosen so that all information in the image
and the palette can be represented without a palette.
The current version supports all possible conversions between
"L", "RGB" and "CMYK." The **matrix** argument only supports "L"
and "RGB".
When translating a color image to greyscale (mode "L"),
the library uses the ITU-R 601-2 luma transform::
L = R * 299/1000 + G * 587/1000 + B * 114/1000
The default method of converting a greyscale ("L") or "RGB"
image into a bilevel (mode "1") image uses Floyd-Steinberg
dither to approximate the original image luminosity levels. If
dither is NONE, all values larger than 128 are set to 255 (white),
all other values to 0 (black). To use other thresholds, use the
:py:meth:`~PIL.Image.Image.point` method.
When converting from "RGBA" to "P" without a **matrix** argument,
this passes the operation to :py:meth:`~PIL.Image.Image.quantize`,
and **dither** and **palette** are ignored.
:param mode: The requested mode. See: :ref:`concept-modes`.
:param matrix: An optional conversion matrix. If given, this
should be 4- or 12-tuple containing floating point values.
:param dither: Dithering method, used when converting from
mode "RGB" to "P" or from "RGB" or "L" to "1".
Available methods are NONE or FLOYDSTEINBERG (default).
Note that this is not used when **matrix** is supplied.
:param palette: Palette to use when converting from mode "RGB"
to "P". Available palettes are WEB or ADAPTIVE.
:param colors: Number of colors to use for the ADAPTIVE palette.
Defaults to 256.
:rtype: :py:class:`~PIL.Image.Image`
:returns: An :py:class:`~PIL.Image.Image` object.
r-r.r<>N)r)r.zillegal conversionr$cSsP|d|d|d|d|d|d|dd}tdtdt|<01><01><02>S)Nrrr#r$g<00>?<3F><>)r<><00>minr<6E>)<02>m<>vrrr<00>convert_transparency<63>s<z+Image.convert.<locals>.convert_transparencyr)cs*g|]"}<01><00>|d|dd<00><00><02><02>qS)r%r)<02>.0<EFBFBD>i)r<><00>matrixr<78>rr<00>
<listcomp><3E>sz!Image.convert.<locals>.<listcomp>rr<F)r*r)r+r.)r)r.r-zVPalette images with Transparency expressed in bytes should be converted to RGBA imagesT)rrz2Couldn't allocate a palette color for transparency)rrz.Transparency for P mode should be bytes or intr)r<>z0Couldn't allocate palette entry for transparency)(r<>rGr<>r<>r<><00>getr<74>rZconvert_matrixr<78>rOrQrg<00>range<67>quantizeZconvert_transparentrf<00>bytes<65>warnings<67>warnr<6E>rkr<>r<><00>getcolorr<72><00>putpixel<65>convert<72>getpixelr<6C>r<>r<><00>ADAPTIVErYr<>r<>r<><00>FLOYDSTEINBERGrMri)rrGr<><00>ditherr<72><00>colorsZhas_transparencyrr<>ZtrnsZ delete_trnsZnew_imr!Ztrns_imr<6D>r)r<>r<>r<>rr<>xs<>*


  


      
 
 
   
 



 
z Image.convertrrc Cs<>|<00><00>|dkr"d}|jdkr"d}|jdkr<|dkr<td<06><01>|r<>|<04><00>|jdkrZtd<08><01>|jd krv|jd
krvtd <0B><01>|j<03>d||j<03>}|<00>|<06>S|<00>|j<03>|||<03><03>}d d lm}|j<03> <09>}|<07>||j<03>
||<08><02>|_ |S)a<>
Convert the image to 'P' mode with the specified number
of colors.
:param colors: The desired number of colors, <= 256
:param method: 0 = median cut
1 = maximum coverage
2 = fast octree
3 = libimagequant
:param kmeans: Integer
:param palette: Quantize to the palette of given
:py:class:`PIL.Image.Image`.
:param dither: Dithering method, used when converting from
mode "RGB" to "P" or from "RGB" or "L" to "1".
Available methods are NONE or FLOYDSTEINBERG (default).
Default: 1 (legacy setting)
:returns: A new image
Nrr<r#)r#r$zoFast Octree (method == 2) and libimagequant (method == 3) are the only valid methods for quantizing RGBA imagesr-zbad mode for palette imager.r)z7only RGB or L mode images can be quantized to a paletter)r<>) r<>rGr<>rr<>r<>r<>rYr<>Zgetpalettemoder<65>r<>) rr<><00>methodZkmeansr<73>r<>rr<>rGrrrr<>4s,


 
zImage.quantizecCs|<00><00>|<00>|j<02><03><00>S)z<>
Copies this image. Use this method if you wish to paste things
into an image, but still retain the original.
:rtype: :py:class:`~PIL.Image.Image`
:returns: An :py:class:`~PIL.Image.Image` object.
)r<>r<>rr<>)rrrrr<>msz
Image.copycCs,|dkr|<00><00>S|<00><01>|<00>|<00>|j|<01><02>S)a<>
Returns a rectangular region from this image. The box is a
4-tuple defining the left, upper, right, and lower pixel
coordinate. See :ref:`coordinate-system`.
Note: Prior to Pillow 3.4.0, this was a lazy operation.
:param box: The crop rectangle, as a (left, upper, right, lower)-tuple.
:rtype: :py:class:`~PIL.Image.Image`
:returns: An :py:class:`~PIL.Image.Image` object.
N)r<>r<>r<><00>_cropr)r<00>boxrrr<00>cropzs z
Image.cropcCsJtttt|<02><02>\}}}}t||<00>t||<00>f}t|<07>|<01>||||f<04>S)a]
Returns a rectangular region from the core image object im.
This is equivalent to calling im.crop((x0, y0, x1, y1)), but
includes additional sanity checks.
:param im: a core image object
:param box: The crop rectangle, as a (left, upper, right, lower)-tuple.
:returns: A core image object.
)r<>r<><00>round<6E>abs<62>_decompression_bomb_checkr)rrr<00>x0<78>y0<79>x1<78>y1Zabsolute_valuesrrrr<><00>s z Image._cropcCsdS)a<>
Configures the image file loader so it returns a version of the
image that as closely as possible matches the given mode and
size. For example, you can use this method to convert a color
JPEG to greyscale while loading it, or to extract a 128x192
version from a PCD file.
Note that this method modifies the :py:class:`~PIL.Image.Image` object
in place. If the image has already been loaded, this method has no
effect.
Note: This method is not implemented for most images. It is
currently implemented only for JPEG and PCD images.
:param mode: The requested mode.
:param size: The requested size.
Nr)rrGrHrrr<00>draft<66>sz Image.draftcCs*|dkr |}|<00><00>|<00>|j<02>||d<01><03>S)Nr)r<>r<>r<00>expand)rZxmarginZymarginrrr<00>_expand<6E>sz Image._expandc
Cs<>ddlm}|<00><02>t|t<04>r$|<01>}t|d<03>s6td<04><01>t||j<07>}|jj dksR|rd|<00>
|<01> |j<08><01>Sg}x2t |jj <09>D]"}|<04> |<00>
|<01> |j<08>|<05><01><01><01>qvWt|j|<04>S)z<>
Filters this image using the given filter. For a list of
available filters, see the :py:mod:`~PIL.ImageFilter` module.
:param filter: Filter kernel.
:returns: An :py:class:`~PIL.Image.Image` object. r)<01> ImageFilter<65>filterz>filter argument should be ImageFilter.Filter instance or class)rYr r<>rfrr r<>ZMultibandFilterrrOr<>r r<>r<><00>getband<6E>mergerG)rr r Z multiband<6E>imsr<73>rrrr <00>s 

 "z Image.filtercCst<00>|j<02>jS)z<>
Returns a tuple containing the name of each band in this image.
For example, **getbands** on an RGB image returns ("R", "G", "B").
:returns: A tuple containing band names.
:rtype: tuple
)rrLrGrO)rrrr<00>getbands<64>szImage.getbandscCs|<00><00>|j<01><02>S)aQ
Calculates the bounding box of the non-zero regions in the
image.
:returns: The bounding box is returned as a 4-tuple defining the
left, upper, right, and lower pixel coordinate. See
:ref:`coordinate-system`. If the image is completely empty, this
method returns None.
)r<>r<00>getbbox)rrrrr<00>s z Image.getbboxcCsl|<00><00>|jdkr`|j<02><03>}g}x*td<02>D]}||r*|<03>|||f<02>q*Wt|<03>|kr\dS|S|j<02>|<01>S)a
Returns a list of colors used in this image.
:param maxcolors: Maximum number of colors. If this number is
exceeded, this method returns None. The default limit is
256 colors.
:returns: An unsorted list of (count, pixel) values.
)r*r)r-r<>N)r<>rGr<00> histogramr<6D>r<>rQ<00> getcolors)rZ maxcolors<72>h<>outr<74>rrrr<00>s


 zImage.getcolorscCs"|<00><00>|dk r|j<01>|<01>S|jS)a<>
Returns the contents of this image as a sequence object
containing pixel values. The sequence object is flattened, so
that values for line one follow directly after the values of
line zero, and so on.
Note that the sequence object returned by this method is an
internal PIL data type, which only supports certain sequence
operations. To convert it to an ordinary sequence (e.g. for
printing), use **list(im.getdata())**.
:param band: What band to return. The default is to return
all bands. To return a single band, pass in the index
value (e.g. 0 to get the "R" band from an "RGB" image).
:returns: A sequence-like object.
N)r<>rr)r<00>bandrrrr<>s z Image.getdatacCsV|<00><00>|jjdkrLg}x*t|jj<02>D]}|<01>|j<01>|<02><01><06><00>q&Wt|<01>S|j<01><06>S)a&
Gets the the minimum and maximum pixel values for each band in
the image.
:returns: For a single-band image, a 2-tuple containing the
minimum and maximum pixel value. For a multi-band image,
a tuple containing one 2-tuple for each band.
r)r<>rrOr<>r<>r<00>
getextremarg)r<00>extremar<61>rrrrs
 zImage.getextremacCs,|jdkrt<01>|_|j<00>|j<03>d<01><01>|jS)NZexif)r<><00>Exifr<66>r<>r<>)rrrr<00>getexif/s
z Image.getexifcCs|<00><00>|jjS)zr
Returns a capsule that points to the internal image memory.
:returns: A capsule object.
)r<>r<00>ptr)rrrr<00>getim5sz Image.getimcCsL|<00><00>y*trt|j<03><04><00>Sdd<02>|j<03><04>D<00>SWntk
rFdSXdS)z<>
Returns the image palette as a list.
:returns: A list of color values [r, g, b, ...], or None if the
image has no palette.
cSsg|] }t|<01><01>qSr)r)r<>r<>rrrr<>Lsz$Image.getpalette.<locals>.<listcomp>N)r<>r <00>listrr<>r<>)rrrrr<>?szImage.getpalettecCs&|<00><00>|jr|j<01>|<01>S|j<03>|<01>S)a 
Returns the pixel value at a given position.
:param xy: The coordinate, given as (x, y). See
:ref:`coordinate-system`.
:returns: The pixel value. If the image is a multi-layer image,
this method returns a tuple.
)r<>r<>r<>r)r<00>xyrrrr<>Ps
 zImage.getpixelcCs2|<00><00>|j<01><02>\}}dd<02>|D<00>dd<02>|D<00>fS)z<>
Get projection to x and y axes
:returns: Two sequences, indicating where there are non-zero
pixels along the X-axis and the Y-axis, respectively.
cSsg|] }t|<01><01>qSr)r)r<>r<>rrrr<>isz'Image.getprojection.<locals>.<listcomp>)r<>r<00> getprojection)r<00>x<>yrrrr _szImage.getprojectioncCsT|<00><00>|r$|<01><00>|j<01>d|j<01>S|jdkrJ|dkr>|<00><04>}|j<01>|<02>S|j<01><02>S)ae
Returns a histogram for the image. The histogram is returned as
a list of pixel counts, one for each pixel value in the source
image. If the image has more than one band, the histograms for
all bands are concatenated (for example, the histogram for an
"RGB" image contains 768 values).
A bilevel image (mode "1") is treated as a greyscale ("L") image
by this method.
If a mask is provided, the method returns a histogram for those
parts of the image where the mask image is non-zero. The mask
image must have the same size as the image, and be either a
bi-level image (mode "1") or a greyscale image ("L").
:param mask: An optional mask.
:param extrema: An optional tuple of manually-specified extrema.
:returns: A list containing pixel counts.
)rr)r+r,N)r<>rrrGr)r<00>maskrrrrrks
 zImage.histogramcCsT|<00><00>|r$|<01><00>|j<01>d|j<01>S|jdkrJ|dkr>|<00><04>}|j<01>|<02>S|j<01><02>S)ah
Calculates and returns the entropy for the image.
A bilevel image (mode "1") is treated as a greyscale ("L")
image by this method.
If a mask is provided, the method employs the histogram for
those parts of the image where the mask image is non-zero.
The mask image must have the same size as the image, and be
either a bi-level image (mode "1") or a greyscale image ("L").
:param mask: An optional mask.
:param extrema: An optional tuple of manually-specified extrema.
:returns: A float value representing the image entropy
)rr)r+r,N)r<>r<00>entropyrGr)rr#rrrrr$<00>s
 z Image.entropycCs td<01><01>dS)NzCoffset() has been removed. Please call ImageChops.offset() instead.)r<>)rZxoffsetZyoffsetrrr<00>offset<65>sz Image.offsetcCst|<02>r|dkr|}d}|dkr$d}t|<02>dkr|t|<01>r@|j}nt|<03>rP|j}ntd<04><01>||d|d|d|df7}t|<01>r<>ddlm}|<05>||j<08>}nBt|<01>r<>|<01> <09>|j|jkr<>|jdks<>|jd kr<>|<01>
|j<08>}|j }|<00> <0C>|<03>r |<03> <09>|j <0B> |||j <0B>n|j <0B> ||<02>dS)
a<EFBFBD>
Pastes another image into this image. The box argument is either
a 2-tuple giving the upper left corner, a 4-tuple defining the
left, upper, right, and lower pixel coordinate, or None (same as
(0, 0)). See :ref:`coordinate-system`. If a 4-tuple is given, the size
of the pasted image must match the size of the region.
If the modes don't match, the pasted image is converted to the mode of
this image (see the :py:meth:`~PIL.Image.Image.convert` method for
details).
Instead of an image, the source can be a integer or tuple
containing pixel values. The method then fills the region
with the given color. When creating RGB images, you can
also use color strings as supported by the ImageColor module.
If a mask is given, this method updates only the regions
indicated by the mask. You can use either "1", "L" or "RGBA"
images (in the latter case, the alpha band is used as mask).
Where the mask is 255, the given image is copied as is. Where
the mask is 0, the current value is preserved. Intermediate
values will mix the two images together, including their alpha
channels if they have them.
See :py:meth:`~PIL.Image.Image.alpha_composite` if you want to
combine images with respect to their alpha channels.
:param im: Source image or pixel value (integer or tuple).
:param box: An optional 4-tuple giving the region to paste into.
If a 2-tuple is used instead, it's treated as the upper left
corner. If omitted or None, the source is pasted into the
upper left corner.
If an image is given as the second argument and there is no
third, the box defaults to (0, 0), and the second argument
is interpreted as a mask image.
:param mask: An optional mask image.
N)rrr#z,cannot determine region size; use 4-item boxrr)<01>
ImageColorr.)r<<00>RGBa)r"rQrHr<>r rYr&r<>rGr<>r<>rr<><00>paste)rrrr#rHr&rrrr(<00>s4( $   z Image.paste<74>rrcCst|ttf<02>std<01><01>t|ttf<02>s,td<02><01>t|<03>dkr@td<04><01>t|<02>dksTtd<06><01>t|<03>dkrhtd<08><01>t|<02>dkr|td <09><01>t|<03>dkr<>||j}|d
|jkr<>|}n
|<01>|<03>}||d|j|d |j f}|d
|jkr<>|}n
|<00>|<05>}t
||<04>}|<00> ||<05>d S) a. 'In-place' analog of Image.alpha_composite. Composites an image
onto this image.
:param im: image to composite over this one
:param dest: Optional 2 tuple (left, top) specifying the upper
left corner in this (destination) image.
:param source: Optional 2 (left, top) tuple for the upper left
corner in the overlay source image, or 4 tuple (left, top, right,
bottom) for the bounds of the source rectangle
Performance Note: Not currently implemented in-place in the core layer.
zSource must be a tuplezDestination must be a tuple)r#r%zSource must be a 2 or 4-tupler#zDestination must be a 2-tuplerzSource must be non-negativez Destination must be non-negative)rrrN) rfrrgr<>rQr<>rHrr<>r<><00>alpha_compositer()rr<00>dest<73>source<63>overlayrZ
background<EFBFBD>resultrrrr*<00>s.     

 

zImage.alpha_compositecs<>|<00><00>t<01>t<02>r<1C><00>|<00>St<04><00>rl|jdkrNt<06><00>\}}|<00>|j<08> ||<04><02>S<00>fdd<03>t
d<04>D<00>|jj <00>|jdkr~t d<06><01>|<00>|j<08><03>|<02><02>S)a<>
Maps this image through a lookup table or function.
:param lut: A lookup table, containing 256 (or 65536 if
self.mode=="I" and mode == "L") values per band in the
image. A function can be used instead, it should take a
single argument. The function is called once for each
possible pixel value, and the resulting table is applied to
all bands of the image.
:param mode: Output mode (default is same as input). In the
current version, this can only be used if the source image
has mode "L" or "P", and the output has mode "1" or the
source image mode is "I" and the output mode is "L".
:returns: An :py:class:`~PIL.Image.Image` object.
)r+zI;16r,csg|] }<01>|<01><01>qSrr)r<>r<>)<01>lutrrr<>GszImage.point.<locals>.<listcomp>r<>r,z+point operation not supported for this mode) r<>rf<00>ImagePointHandler<65>point<6E>callablerGr<>r<>rZpoint_transformr<6D>rOr<>)rr/rG<00>scaler%r)r/rr1(s


 
z Image.pointc Cs@|<00><00>|jdkr<>ylt|j<01>d}y|j<03>|<02>Wn8ttfk
rj|j<03>|<02>}|jdkr`t<06>||_YnXd|_|jj|_Wn t tfk
r<EFBFBD>td<04><01>YnX|jdkr<>d}nd}t
|<01>r<>|jdkr<>td<04><01>|<01> <0B>|jd kr<>|<01>d
<EFBFBD>}n@y|j<03> ||<01>Wn(ttfk
<EFBFBD>r&t d
|j|<01>}YnXdS|j<03>|j|<04>dS) az
Adds or replaces the alpha layer in this image. If the image
does not have an alpha layer, it's converted to "LA" or "RGBA".
The new layer must be either "L" or "1".
:param alpha: The new alpha layer. This can either be an "L" or "1"
image having the same size as this image, or an integer or
other color value.
)rEr<>r<r3Nzillegal image mode)rEr<>rr$)r*r)r*r))r<>rGrMrZsetmoderlr<>r<>r<>rir"r<>Zfillbandr<64>rHZputband)r<00>alpharGrrrrr<00>putalphaOs< 
 
 


 zImage.putalpha<68><00>?<3F>cCs|<00><00>|j<01>|||<03>dS)a
Copies pixel data to this image. This method copies data from a
sequence object into the image, starting at the upper left
corner (0, 0), and continuing until either the image or the
sequence ends. The scale and offset values are used to adjust
the sequence values: **pixel = value*scale + offset**.
:param data: A sequence object.
:param scale: An optional scale value. The default is 1.0.
:param offset: An optional offset value. The default is 0.0.
N)r<>r<00>putdata)rrzr3r%rrrr8<00>s z Image.putdatar.cCs<>ddlm}|jdkrtd<04><01>|<00><04>t||j<01>rD|<03>|j|j<08>}n8t|t <09>spt
r\t |<01>}nd<05> dd<07>|D<00><01>}|<03>||<01>}d|jkr<>d nd
|_||_d |j_|<00><04>d S) a<>
Attaches a palette to this image. The image must be a "P",
"PA", "L" or "LA" image, and the palette sequence must contain
768 integer values, where each group of three values represent
the red, green, and blue values for the corresponding pixel
index. Instead of an integer sequence, you can use an 8-bit
string.
:param data: A palette sequence (either a list or a string).
:param rawmode: The raw mode of the palette.
r)r<>)r)rEr-r<>zillegal image moderYcss|]}t|<01>VqdS)N)<01>chr)r<>r!rrr<00> <genexpr><3E>sz#Image.putpalette.<locals>.<genexpr>r3r<>r-r.N) rYr<>rGr<>r<>rfr<>r<>r<>r<>r r<>)rrzr<>r<>r<>rrrr<><00>s 
 

 zImage.putpalettecCsh|jr|<00><01>|<00><02>|jr*|j<03>||<02>S|jdkrZt|ttf<02>rZt |<02>dkrZ|j
<EFBFBD> |<02>}|j <0C>||<02>S)a<>
Modifies the pixel at the given position. The color is given as
a single numerical value for single-band images, and a tuple for
multi-band images. In addition to this, RGB and RGBA tuples are
accepted for P images.
Note that this method is relatively slow. For more extensive changes,
use :py:meth:`~PIL.Image.Image.paste` or the :py:mod:`~PIL.ImageDraw`
module instead.
See:
* :py:meth:`~PIL.Image.Image.paste`
* :py:meth:`~PIL.Image.Image.putdata`
* :py:mod:`~PIL.ImageDraw`
:param xy: The pixel coordinate, given as (x, y). See
:ref:`coordinate-system`.
:param value: The pixel value.
r-)r$r%) r<>r<>r<>r<>r<>rGrfrrgrQr<>r<>r)rrrxrrrr<><00>s
  zImage.putpixelc Cs*ddlm}|jdkrtd<04><01>|dkr^|jdkrF|j<04>d<07>dd<08>}qbtd d
<EFBFBD>td<08>D<00><01>}n|}d }d gd }x8t|<01>D],\}}|||d|dd<00>7}|||<qzWt|<06>} |<00> <09>}
d|
_|jd| ddd<0F>|
_
|
jj |
j
<EFBFBD> <0C><00>|
<EFBFBD> d<10>}
|dt|<05>d} |
<EFBFBD> | <0B>|jd|t|<05>d<0F>|
_
|
S)a]
Rewrites the image to reorder the palette.
:param dest_map: A list of indexes into the original palette.
e.g. [1,0] would swap a two item palette, and list(range(256))
is the identity transform.
:param source_palette: Bytes or None.
:returns: An :py:class:`~PIL.Image.Image` object.
r)r<>)r)r-zillegal image modeNr-r.icss|]}|dVqdS)r$Nr)r<>r<>rrrr:<00>sz&Image.remap_palette.<locals>.<genexpr>r<>rr<>r$)r<>rHr)<00>)rYr<>rGr<>rr<><00> bytearrayr<79><00> enumerater<65>r<>r<>r<>r<>rQ) rZdest_mapZsource_paletter<65>Zreal_source_paletteZ palette_bytesZ new_positionsr<73><00> oldPositionZmapping_paletteZm_imZnew_palette_bytesrrr<00> remap_palette<74>s2 


 

zImage.remap_palettecCs(|ttttttfkrzd<01>|<02>}dd<03>tdftdftdftdftdftd ffD<00>}t|d
d <0B>|d d <0A><00>d|d <00><01>t |<01>}|d kr<>d|j
}nt |<03>}|j
|kr<>|d|j
kr<>|<00> <0B>S|j dkr<>t}|j dk<06>r
|<00> |j d d <0A>d<00>}|<06>|||<03>}|<06> |j <0C>S|<00><0F>|<00>|j<11>|||<03><03>S)a<>
Returns a resized copy of this image.
:param size: The requested size in pixels, as a 2-tuple:
(width, height).
:param resample: An optional resampling filter. This can be
one of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BOX`,
:py:attr:`PIL.Image.BILINEAR`, :py:attr:`PIL.Image.HAMMING`,
:py:attr:`PIL.Image.BICUBIC` or :py:attr:`PIL.Image.LANCZOS`.
If omitted, or if the image has mode "1" or "P", it is
set :py:attr:`PIL.Image.NEAREST`.
See: :ref:`concept-filters`.
:param box: An optional 4-tuple of floats giving the region
of the source image which should be scaled.
The values should be within (0, 0, width, height) rectangle.
If omitted or None, the entire source is used.
:returns: An :py:class:`~PIL.Image.Image` object.
zUnknown resampling filter ({}).cSs g|]}d<00>|d|d<00><02>qS)z{} ({})rr)r<>)r<>r rrrr<>>sz Image.resize.<locals>.<listcomp>z Image.NEARESTz Image.LANCZOSzImage.BILINEARz Image.BICUBICz Image.BOXz Image.HAMMINGz Use z, N<><4E><EFBFBD><EFBFBD><EFBFBD>z or )rr)r*r-)rEr<r<>)<12>NEAREST<53>BILINEAR<41>BICUBIC<49>LANCZOS<4F>BOX<4F>HAMMINGr<47>r<>r<>rgrHr<>rGr<><00>resizer<65>r<>r)rrH<00>resampler<00>message<67>filtersrrrrrG&s2
( 
  z Image.resizecCs2|d}|s^|s^|dkr |<00><00>S|dkr2|<00>t<02>S|dkrH|rH|<00>t<03>S|dkr^|r^|<00>t<04>S|j\}}|dkrvd} n|} |dkr<>|d|df}
n|}
t<06>|<01> }tt<06> |<01>d <09>tt<06>
|<01>d <09>d
tt<06>
|<01> d <09>tt<06> |<01>d <09>d
g} d d <0C>} | |
d | d|
d  | d | <0B>\| d<| d<| d|
d7<| d|
d 7<|<03>rg} g}xJd|df||fd|ffD].\}}| ||| <0B>\}}| <0A> |<0F>|<0E> |<10><00>qrWt t<06> t| <0A><01>t<06>t| <0A><01><00>}t t<06> t|<0E><01>t<06>t|<0E><01><00>}| || d|| d| <0B>\| d<| d<||}}|j||ft| ||d<10>S)a<>
Returns a rotated copy of this image. This method returns a
copy of this image, rotated the given number of degrees counter
clockwise around its centre.
:param angle: In degrees counter clockwise.
:param resample: An optional resampling filter. This can be
one of :py:attr:`PIL.Image.NEAREST` (use nearest neighbour),
:py:attr:`PIL.Image.BILINEAR` (linear interpolation in a 2x2
environment), or :py:attr:`PIL.Image.BICUBIC`
(cubic spline interpolation in a 4x4 environment).
If omitted, or if the image has mode "1" or "P", it is
set :py:attr:`PIL.Image.NEAREST`. See :ref:`concept-filters`.
:param expand: Optional expansion flag. If true, expands the output
image to make it large enough to hold the entire rotated image.
If false or omitted, make the output image the same size as the
input image. Note that the expand flag assumes rotation around
the center and no translation.
:param center: Optional center of rotation (a 2-tuple). Origin is
the upper left corner. Default is the center of the image.
:param translate: An optional post-rotate translation (a 2-tuple).
:param fillcolor: An optional color for area outside the rotated image.
:returns: An :py:class:`~PIL.Image.Image` object.
g<00>v@r<00><><00>ZiN)rrg@<40>gc Ss8|\}}}}}}||||||||||fS)Nr) r!r"r<>r<>r<>r<>r<>rcr<>rrr<00> transform<72>szImage.rotate.<locals>.transformrr#r&)<01> fillcolor)r<><00> transpose<73>
ROTATE_180<EFBFBD> ROTATE_90<39>
ROTATE_270rH<00>math<74>radiansr<00>cos<6F>sinr<6E>r<><00>ceilr<6C><00>floorr<72>rN<00>AFFINE)rZanglerHr
<00>center<65> translaterO<00>wrZ
post_transZ rotn_centerr<72>rNZxx<78>yyr!r"<00>nwZnhrrr<00>rotatebsR"
 
 

 2"
  ,
z Image.rotatec KsRd}d}t|<01>r|}d}ntr4t|t<03>r4t|<01>}d}|sRt|d<04>rRt|j<06>rR|j}|<00><07>|<03>dd<02>}||_ d|_
t <0B>t j <0A>|<04>d<00><0F>}|s<>|tkr<>t<11>y t|}Wn"tk
r<EFBFBD>td<08>|<07><01><01>YnX|<02><15>tkr<>t<11>|r<>t|<02><15>}n t|<02><15>}|<05>r,|<03>d d<02><02>r t<19>|d
<EFBFBD>}n t<19>|d <0B>}z||||<04>Wd |<05>rL|<01><1B>Xd S) a<>
Saves this image under the given filename. If no format is
specified, the format to use is determined from the filename
extension, if possible.
Keyword options can be used to provide additional instructions
to the writer. If a writer doesn't recognise an option, it is
silently ignored. The available options are described in the
:doc:`image format documentation
<../handbook/image-file-formats>` for each writer.
You can use a file object instead of a filename. In this case,
you must always specify the format. The file object must
implement the ``seek``, ``tell``, and ``write``
methods, and be opened in binary mode.
:param fp: A filename (string), pathlib.Path object or file object.
:param format: Optional format override. If omitted, the
format to use is determined from the filename extension.
If a file object was used instead of a filename, this
parameter should always be used.
:param params: Extra parameters to the image writer.
:returns: None
:exception ValueError: If the output format could not be determined
from the file name. Use the format option to solve this.
:exception IOError: If the file could not be written. The file
may have been created, and may contain partial data.
rYFTr<54><00>save_allrrzunknown file extension: {}r<>zr+bzw+bN)r <00> HAS_PATHLIBrfr<00>strr r<>r<><00>popZ encoderinfoZ encoderconfigr[r<><00>path<74>splitext<78>lower<65> EXTENSIONrdrir<>r<><00>upperrb<00>SAVE_ALLr<4C><00>builtins<6E>openr<6E>) rr<>r<><00>paramsr<73>Zopen_fpra<00>extZ save_handlerrrrr<><00>sH     z
Image.savecCs|dkr t<00>dS)a<>
Seeks to the given frame in this sequence file. If you seek
beyond the end of the sequence, the method raises an
**EOFError** exception. When a sequence file is opened, the
library automatically seeks to frame 0.
See :py:meth:`~PIL.Image.Image.tell`.
:param frame: Frame number, starting at 0.
:exception EOFError: If the call attempts to seek beyond the end
of the sequence.
rN)<01>EOFError)r<00>framerrr<00>seek*sz
Image.seekcCst|||d<01>dS)a<>
Displays this image. This method is mainly intended for
debugging purposes.
The image is first saved to a temporary file. By default, it will be in
PNG format.
On Unix, the image is then opened using the **display**, **eog** or
**xv** utility, depending on which one can be found.
On macOS, the image is opened with the native Preview application.
On Windows, the image is opened with the standard PNG display utility.
:param title: Optional title to use for the image window,
where possible.
:param command: command used to show the image
)<02>title<6C>commandN)<01>_show)rrrrsrrr<00>show<sz
Image.showcCs:|<00><00>|jjdkr |<00><03>g}nt|j|j<01><06><00>}t|<01>S)a<>
Split this image into individual bands. This method returns a
tuple of individual image bands from an image. For example,
splitting an "RGB" image creates three new images each
containing a copy of one of the original bands (red, green,
blue).
If you need only one band, :py:meth:`~PIL.Image.Image.getchannel`
method can be more convenient and faster.
:returns: A tuple containing bands.
r)r<>rrOr<>r<>r<><00>splitrg)rrrrrrvRs
  z Image.splitcCsX|<00><00>t|<01>rFy|<00><02><00>|<01>}Wn"tk
rDtd<01>|<01><01><01>YnX|<00>|j<07>|<01><01>S)a@
Returns an image containing a single channel of the source image.
:param channel: What channel to return. Could be index
(0 for "R" channel of "RGB") or channel name
("A" for alpha channel of "RGBA").
:returns: An image in "L" mode.
.. versionadded:: 4.3.0
zThe image has no channel "{}") r<>r r<00>indexr<78>r<>r<>rr)rZchannelrrr<00>
getchannelgs zImage.getchannelcCsdS)z<>
Returns the current frame number. See :py:meth:`~PIL.Image.Image.seek`.
:returns: Frame number, starting with 0.
rr)rrrr<00>tell|sz
Image.tellcCs<>|j\}}||dkr<tt||d|d<02><02>}t|d<00>}||dkrntt||d|d<02><02>}t|d<00>}||f}||jkr<>dS|<00>d|<01>|j|kr<>|<00>||<02>}|j|_||_|jj|_d|_d|_ dS)a=
Make this image into a thumbnail. This method modifies the
image to contain a thumbnail version of itself, no larger than
the given size. This method calculates an appropriate thumbnail
size to preserve the aspect of the image, calls the
:py:meth:`~PIL.Image.Image.draft` method to configure the file reader
(where applicable), and finally resizes the image.
Note that this function modifies the :py:class:`~PIL.Image.Image`
object in place. If you need to use the full resolution image as well,
apply this method to a :py:meth:`~PIL.Image.Image.copy` of the original
image.
:param size: Requested size.
:param resample: Optional resampling filter. This can be one
of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`,
:py:attr:`PIL.Image.BICUBIC`, or :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)
:returns: None
rrN)
rHr<>r<>r rGrr<>rGr<>r<>)rrHrHr!r"rrrr<00> thumbnail<69>s$
    
 
 
zImage.thumbnailc
Cs<>|jdkr*|<00>d<02><01>||||||<06><06>d<01>S|jdkrT|<00>d<04><01>||||||<06><06>d<03>St|t<04>rp|j||||d<05>St|d<06>r<>|<02><06>\}}|dkr<>td<08><01>t|j||<06>}|t kr<>xF|D] \}} |<07>
||t | ||dk<08>q<>Wn|<07>
d ||||||dk<08>|S)
a\
Transforms this image. This method creates a new image with the
given size, and the same mode as the original, and copies data
to the new image using the given transform.
:param size: The output size.
:param method: The transformation method. This is one of
:py:attr:`PIL.Image.EXTENT` (cut out a rectangular subregion),
:py:attr:`PIL.Image.AFFINE` (affine transform),
:py:attr:`PIL.Image.PERSPECTIVE` (perspective transform),
:py:attr:`PIL.Image.QUAD` (map a quadrilateral to a rectangle), or
:py:attr:`PIL.Image.MESH` (map a number of source quadrilaterals
in one operation).
It may also be an :py:class:`~PIL.Image.ImageTransformHandler`
object::
class Example(Image.ImageTransformHandler):
def transform(size, method, data, resample, fill=1):
# Return result
It may also be an object with a :py:meth:`~method.getdata` method
that returns a tuple supplying new **method** and **data** values::
class Example(object):
def getdata(self):
method = Image.EXTENT
data = (0, 0, 100, 100)
return method, data
:param data: Extra data to the transformation method.
:param resample: Optional resampling filter. It can be one of
:py:attr:`PIL.Image.NEAREST` (use nearest neighbour),
:py:attr:`PIL.Image.BILINEAR` (linear interpolation in a 2x2
environment), or :py:attr:`PIL.Image.BICUBIC` (cubic spline
interpolation in a 4x4 environment). If omitted, or if the image
has mode "1" or "P", it is set to :py:attr:`PIL.Image.NEAREST`.
:param fill: If **method** is an
:py:class:`~PIL.Image.ImageTransformHandler` object, this is one of
the arguments passed to it. Otherwise, it is unused.
:param fillcolor: Optional fill color for the area outside the
transform in the output image.
:returns: An :py:class:`~PIL.Image.Image` object.
rEZLar<r')rH<00>fillr<6C>Nzmissing method data)rr) rGr<>rNrf<00>ImageTransformHandlerr r<>r<>r<><00>MESH<53>_Image__transformer<65>QUAD)
rrHr<>rzrHr{rOrrZquadrrrrN<00>s*-





 zImage.transformc
CsH|d|d}|d|d}|tkr8|dd<05>}<04>n@|tkr<>|\} }
} } t| | <00>|} t| |
<00>|}t}| d| d||
f}n<>|tkr<>|dd<06>}n<>|tk<02>rp|dd<01>}|dd<07>}|dd<05>}|dd<06>}|\} }
d|}d|}| |d| ||d| ||d|d|d| |||
|d|
||d|
||d|d|d|
||f}ntd <09><01>|tttfk<07>r |t t
t fk<06>r<>t d
t
d t d i|d <0A> |<05>}n
d<0E> |<05>}dd<10>tdftdftdffD<00>}t|dd<15> |dd<16><00>d|d<00><01>|<02><0E>|<00><0E>|jdk<06>r,t}|j<10>||j||||<06>dS)Nr#rr$rr'<00>r%g<00>?zunknown transformation methodz Image.BOXz Image.HAMMINGzImage.LANCZOS/Image.ANTIALIASz ({}) cannot be used.zUnknown resampling filter ({}).cSs g|]}d<00>|d|d<00><02>qS)z{} ({})rr)r<>)r<>r rrrr<>< sz'Image.__transformer.<locals>.<listcomp>z Image.NEARESTzImage.BILINEARz Image.BICUBICz Use z, r@z or )r*r-)rZ<00>EXTENT<4E>float<61> PERSPECTIVErr<>rArBrCrErFrDr<>r<>r<>rGrZ
transform2)rrr<>r<>rzrHr{r]rrrrr<00>xsZysr_<00>sw<73>se<73>neZAsZAtrIrJrrrZ __transformer s^ 
    "(
( zImage.__transformercCs|<00><00>|<00>|j<02>|<01><01>S)a<>
Transpose image (flip or rotate in 90 degree steps)
:param method: One of :py:attr:`PIL.Image.FLIP_LEFT_RIGHT`,
:py:attr:`PIL.Image.FLIP_TOP_BOTTOM`, :py:attr:`PIL.Image.ROTATE_90`,
:py:attr:`PIL.Image.ROTATE_180`, :py:attr:`PIL.Image.ROTATE_270`,
:py:attr:`PIL.Image.TRANSPOSE` or :py:attr:`PIL.Image.TRANSVERSE`.
:returns: Returns a flipped or rotated copy of this image.
)r<>r<>rrP)rr<>rrrrPP s zImage.transposecCs|<00><00>|<00>|j<02>|<01><01>S)zj
Randomly spread pixels in an image.
:param distance: Distance to spread pixels.
)r<>r<>r<00> effect_spread)rZdistancerrrr<>^ szImage.effect_spreadcCs$ddlm}|jstd<03><01>|<01>|<00>S)z#Returns a QImage copy of this imager)<01>ImageQtzQt bindings are not installed)rYr<><00>qt_is_installedr<00>toqimage)rr<>rrrr<>g s zImage.toqimagecCs$ddlm}|jstd<03><01>|<01>|<00>S)z$Returns a QPixmap copy of this imager)r<>zQt bindings are not installed)rYr<>r<>r<00> toqpixmap)rr<>rrrr<>o s zImage.toqpixmap)NN)r<>)r<>)r<>)r<>NrNr)N)N)r<>)N)NN)NN)N)NN)r)r))N)r6r7)r.)N)N)NN)Urrr<00>__doc__r<5F><00>format_descriptionZ!_close_exclusive_fp_after_loadingr{<00>propertyr<79>r<>rHr<>r<>r<>r<><00>sys<79> version_info<66>majorr<72>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<><00>WEBr<42>r<>r<><00>__copy__rr<>r r r rrrr<>rrrr<>r<>r rr$r%r(r*r1r5r8r<>r<>r?rArGr`r<>rqrurvrxryrCrzrNr~rPr<>r<>r<>rrrrr<>s<>
    
 
 
+

' =
9 









P
0
'6

&
K? n
S
 3PI r<>c@s eZdZdS)r0N)rrrrrrrr0| sr0c@s eZdZdS)r|N)rrrrrrrr|<00> sr|cCst<00><00>t<02>d<01><01>S)z+Create greyscale wedge (for debugging only)r))r<>r<>rkZwedgerrrr<00>_wedge<67> sr<>cCsNt|ttf<02>std<01><01>t|<00>dkr*td<03><01>|ddksB|ddkrJtd<06><01>dS)z<>
Common check to enforce type and sanity check on size tuples
:param size: Should be a 2 tuple of (width, height)
:returns: True, or raises a ValueError
zSize must be a tupler#z Size must be a tuple of length 2rrzWidth and height must be >= 0T)rfrrgr<>rQ)rHrrr<00> _check_size<7A> s r<>cCs<>t|<01>|dkr$t<01><00>t<03>||<01><02>St|<02>rDddlm}|<03>||<00>}t<01>}|dkr<>t |t
t f<02>r<>t |<02>dkr<>ddlm }|<05> <0A>|_|j<0E>|<02>}|<04>t<03>|||<02><03>S)a<>
Creates a new image with the given mode and size.
:param mode: The mode to use for the new image. See:
:ref:`concept-modes`.
:param size: A 2-tuple, containing (width, height) in pixels.
:param color: What color to use for the image. Default is black.
If given, this should be a single integer or floating point value
for single-band modes, and a tuple for multi-band modes (one value
per band). When creating RGB images, you can also use color
strings as supported by the ImageColor module. If the color is
None, the image is not initialised.
:returns: An :py:class:`~PIL.Image.Image` object.
Nr)r&r-)r$r%)r<>)r<>r<>r<>rkr<>r rYr&r<>rfrrgrQr<>r<>r{)rGrH<00>colorr&rr<>rrrr<><00> s  " 
 r<>r<>cGsZt|<01>t|<04>dkr*t|dt<03>r*|d}|dkr>|dkr>|}t||<01>}|<05>|||<04>|S)a<>
Creates a copy of an image memory from pixel data in a buffer.
In its simplest form, this function takes three arguments
(mode, size, and unpacked pixel data).
You can also use any pixel decoder supported by PIL. For more
information on available decoders, see the section
:ref:`Writing Your Own File Decoder <file-decoders>`.
Note that this function decodes pixel data only, not entire images.
If you have an entire image in a string, wrap it in a
:py:class:`~io.BytesIO` object, and use :py:func:`~PIL.Image.open` to load
it.
:param mode: The image mode. See: :ref:`concept-modes`.
:param size: The image size.
:param data: A byte buffer containing raw data for the given mode.
:param decoder_name: What decoder to use.
:param args: Additional parameters for the given decoder.
:returns: An :py:class:`~PIL.Image.Image` object.
rrr<>r)r<>rQrfrgr<>r<>)rGrHrzrnrorrrrr<><00> s
r<>cOs td<01><01>dS)Nz?fromstring() has been removed. Please call frombytes() instead.)r<>)ror<>rrrr<><00> sr<>c
Gs<>t|<01>t|<04>dkr*t|dt<03>r*|d}|dkr<>|dkrTtjdtdd<07>|ddf}|dtkr<>t|d <09>}|<05> t
<EFBFBD> |||d
d|<04><06>}d|_ |St |||||<04>S) a<>
Creates an image memory referencing pixel data in a byte buffer.
This function is similar to :py:func:`~PIL.Image.frombytes`, but uses data
in the byte buffer, where possible. This means that changes to the
original buffer object are reflected in this image). Not all modes can
share memory; supported modes include "L", "RGBX", "RGBA", and "CMYK".
Note that this function decodes pixel data only, not entire images.
If you have an entire image file in a string, wrap it in a
**BytesIO** object, and use :py:func:`~PIL.Image.open` to load it.
In the current version, the default parameters used for the "raw" decoder
differs from that used for :py:func:`~PIL.Image.frombytes`. This is a
bug, and will probably be fixed in a future release. The current release
issues a warning if you do this; to disable the warning, you should provide
the full set of parameters. See below for details.
:param mode: The image mode. See: :ref:`concept-modes`.
:param size: The image size.
:param data: A bytes or other buffer object containing raw
data for the given mode.
:param decoder_name: What decoder to use.
:param args: Additional parameters for the given decoder. For the
default encoder ("raw"), it's recommended that you provide the
full set of parameters::
frombuffer(mode, size, data, "raw", mode, 0, 1)
:returns: An :py:class:`~PIL.Image.Image` object.
.. versionadded:: 1.1.4
rrr<>rz<>the frombuffer defaults will change in Pillow 7.0.0; for portability, change the call to read:
frombuffer(mode, size, data, 'raw', mode, 0, 1)r#)<01>
stacklevelr@)rrN)r<>rQrfrgr<>r<><00>RuntimeWarning<6E> _MAPMODESr<53>r<>rkZ
map_bufferr<EFBFBD>r<>)rGrHrzrnrorrrr<00>
frombuffer<EFBFBD> s #
 
r<>c
Cs<>|j}|d}t|<03>}|<02>dd<03>}|dkrry(d|dd<03>|df}t|\}}Wqvtk
rntd<07><01>YqvXn|}|dkr<>d}n|d kr<>d
}nd }||kr<>td ||f<00><01>|d |df} |dk r<>t|d<0F>r<>|<00><08>}n|<00> <09>}t
|| |d|dd <0A>S)a<>
Creates an image memory from an object exporting the array interface
(using the buffer protocol).
If **obj** is not contiguous, then the tobytes method is called
and :py:func:`~PIL.Image.frombuffer` is used.
If you have an image in NumPy::
from PIL import Image
import numpy as np
im = Image.open('hopper.jpg')
a = np.asarray(im)
Then this can be used to convert it to a Pillow image::
im = Image.fromarray(a)
:param obj: Object with array interface
:param mode: Mode to use (will be determined from type if None)
See: :ref:`concept-modes`.
:returns: An image object.
.. versionadded:: 1.1.6
r<><00>stridesN)rrr#r<>zCannot handle this data type)r*r)r+r-r,r.r$r%zToo many dimensions: %d > %d.rrr<>r<>) r<>rQr<><00>_fromarray_typemaprir<>r<>r r<>r<>r<>)
<EFBFBD>objrGZarrr<72><00>ndimr<6D>Ztypekeyr<79>ZndmaxrHrrr<00> fromarray4
s0 

r<>cCs$ddlm}|jstd<03><01>|<01>|<00>S)z-Creates an image instance from a QImage imager)r<>zQt bindings are not installed)rYr<>r<>r<00>
fromqimage)rr<>rrrr<>m
s r<>cCs$ddlm}|jstd<03><01>|<01>|<00>S)z.Creates an image instance from a QPixmap imager)r<>zQt bindings are not installed)rYr<>r<>r<00> fromqpixmap)rr<>rrrr<>v
s r<>)r*z1;8)r)r))r+zI;8)r+zI;16)r+zI;16B)r+zI;16S)r+zI;16BS)r+zI;32)r+zI;32B)r+zI;32S)r+zI;32BS)r,zF;32F)r,zF;32BF)r,zF;64F)r,zF;64BF)rErE)r.r.)r<r<)))rrz|b1))rrz|u1))rrz|i1))rrz<u2))rrz>u2))rrz<i2))rrz>i2))rrz<u4))rrz>u4))rrz<i4))rrz>i4))rrz<f4))rrz>f4))rrz<f8))rrz>f8))rrr#z|u1))rrr$z|u1))rrr%z|u1)r+r+)rr)r,r,cCs\tdkr dS|d|d}|dtkr<td|dtf<00><01>|tkrXt<02>d|tft<04>dS)Nrrr#zZImage size (%d pixels) exceeds limit of %d pixels, could be decompression bomb DOS attack.)<05>MAX_IMAGE_PIXELSrr<>r<>r)rHZpixelsrrrr<00>
s r<00>rc s(|dkrtd|<00><01>d<03>d}tr8t|t<03>r8t|<00><05><00>}n t|<00>rD|}|rXt<07>|d<05>}d<06>y|<00> d<07>Wn,t
t j fk
r<EFBFBD>t <0B> |<00><0E><00>}d<06>YnX|<00>d<08>}t<0F>g<00><00><00>fd d
<EFBFBD>}||||<03>}|d kr<>t<10>r<>||||<03>}|r<><72>|_|S<00>r<>|<00><12>x<16>D]}t<13>|<06>q<>Wtd |<02>r|n|<00><01>d S) a6
Opens and identifies the given image file.
This is a lazy operation; this function identifies the file, but
the file remains open and the actual image data is not read from
the file until you try to process the data (or call the
:py:meth:`~PIL.Image.Image.load` method). See
:py:func:`~PIL.Image.new`. See :ref:`file-handling`.
:param fp: A filename (string), pathlib.Path object or a file object.
The file object must implement :py:meth:`~file.read`,
:py:meth:`~file.seek`, and :py:meth:`~file.tell` methods,
and be opened in binary mode.
:param mode: The mode. If given, this argument must be "r".
:returns: An :py:class:`~PIL.Image.Image` object.
:exception IOError: If the file cannot be found, or the image cannot be
opened and identified.
r<>z bad mode %rFrY<00>rbTr<00>c s<>x<>tD]<5D>}y`t|\}}| p$||<02>}t|<06>ttgkrB<72><00>|<06>n&|rh|<00>d<01>|||<01>}t|j<08>|SWqt t
t t j fk
r<EFBFBD>wYqtk
r<EFBFBD><00>r<>|<00><0F><00>YqXqWdS)Nr)<10>IDra<00>typercr<>r<>rqrrH<00> SyntaxError<6F>
IndexErrorr<EFBFBD><00>struct<63>error<6F> BaseExceptionr<6E>)r<>r<><00>prefixr<78><00>factory<72>acceptr.r)<02>accept_warnings<67> exclusive_fprr<00>
_open_core<EFBFBD>
s$
  


 zopen.<locals>._open_coreNzcannot identify image file %r)r<>rbrfrrc<00>resolver rkrlrqrlr<><00>UnsupportedOperationr<6E><00>readr[rdr<>r<>r<>r<>rm)r<>rGr<>r<>r<>rrIr)r<>r<>rrl<00>
s@  

  
rlcCs&|<00><00>|<01><00>|<00>t<02>|j|j<04><02>S)z<>
Alpha composite im2 over im1.
:param im1: The first image. Must have mode RGBA.
:param im2: The second image. Must have mode RGBA, and the same size as
the first image.
:returns: An :py:class:`~PIL.Image.Image` object.
)r<>r<>rkr*r)<02>im1<6D>im2rrrr* s
r*cCs(|<00><00>|<01><00>|<00>t<02>|j|j|<02><03>S)a<>
Creates a new image by interpolating between two input images, using
a constant alpha.::
out = image1 * (1.0 - alpha) + image2 * alpha
:param im1: The first image.
:param im2: The second image. Must have the same mode and size as
the first image.
:param alpha: The interpolation alpha factor. If alpha is 0.0, a
copy of the first image is returned. If alpha is 1.0, a copy of
the second image is returned. There are no restrictions on the
alpha value. If necessary, the result is clipped to fit into
the allowed output range.
:returns: An :py:class:`~PIL.Image.Image` object.
)r<>r<>rk<00>blendr)r<>r<>r4rrrr<> sr<>cCs|<01><00>}|<03>|d|<02>|S)af
Create composite image by blending images using a transparency mask.
:param image1: The first image.
:param image2: The second image. Must have the same mode and
size as the first image.
:param mask: A mask image. This image can have mode
"1", "L", or "RGBA", and must have the same size as the
other two images.
N)r<>r()Zimage1Zimage2r#r<>rrr<00> composite/ s r<>cGs|<00>|d<00>S)a<>
Applies the function (which should take one argument) to each pixel
in the given image. If the image has more than one band, the same
function is applied to each band. Note that the function is
evaluated once for each possible pixel value, so you cannot use
random components or other generators.
:param image: The input image.
:param function: A function object, taking one integer argument.
:returns: An :py:class:`~PIL.Image.Image` object.
r)r1)r<>rorrr<00>eval@ s r<>cCs<>t|<00>t|<01>ksd|kr td<02><01>xB|dd<04>D]2}|jt|<00>krHtd<05><01>|j|djkr.td<07><01>q.Wx|D] }|<02><06>qjW|d<00>tj |fdd <09>|D<00><01><02><00>S)
am
Merge a set of single band images into a new multiband image.
:param mode: The mode to use for the output image. See:
:ref:`concept-modes`.
:param bands: A sequence containing one single-band image for
each band in the output image. All bands must have the
same size.
:returns: An :py:class:`~PIL.Image.Image` object.
<20>*zwrong number of bandsrNz mode mismatchrz size mismatchcSsg|]
}|j<00>qSr)r)r<>r<>rrrr<>e szmerge.<locals>.<listcomp>)
rRrQr<>rGrNrHr<>r<>rkr)rGrOrrrrrP s  
 rcCs"|<00><00>}t<01>|<00>||ft|<dS)a1
Register an image file plugin. This function should not be used
in application code.
:param id: An image format identifier.
:param factory: An image file factory method.
:param accept: An optional function that can be used to quickly
reject images having another format.
N)rir<>r<>ra)rr<>r<>rrr<00> register_openl s

r<>cCs|t|<00><01><dS)z<>
Registers an image MIME type. This function should not be used
in application code.
:param id: An image format identifier.
:param mimetype: The image MIME type for this format.
N)<02>MIMEri)r<00>mimetyperrr<00> register_mime{ sr<>cCs|t|<00><01><dS)z<>
Registers an image save function. This function should not be
used in application code.
:param id: An image format identifier.
:param driver: A function to save images in this format.
N)rbri)r<00>driverrrr<00> register_save<76> sr<>cCs|t|<00><01><dS)z<>
Registers an image function to save all the frames
of a multiframe format. This function should not be
used in application code.
:param id: An image format identifier.
:param driver: A function to save images in this format.
N)rjri)rr<>rrr<00>register_save_all<6C> s r<>cCs|<00><00>t|<01><02><dS)z<>
Registers an image extension. This function should not be
used in application code.
:param id: An image format identifier.
:param extension: An extension used for this format.
N)rirhrg)r<00> extensionrrr<00>register_extension<6F> sr<>cCsx|D]}t||<02>qWdS)z<>
Registers image extensions. This function should not be
used in application code.
:param id: An image format identifier.
:param extensions: A list of extensions used for this format.
N)r<>)r<00>
extensionsr<EFBFBD>rrr<00>register_extensions<6E> s
r<>cCsts
t<01>tS)za
Returns a dictionary containing all file extensions belonging
to registered plugins
)rhrdrrrr<00>registered_extensions<6E> sr<>cCs |t|<dS)a
Registers an image decoder. This function should not be
used in application code.
:param name: The name of the decoder
:param decoder: A callable(mode, args) that returns an
ImageFile.PyDecoder object
.. versionadded:: 4.1.0
N)rh)r<>rprrr<00>register_decoder<65> s r<>cCs |t|<dS)a
Registers an image encoder. This function should not be
used in application code.
:param name: The name of the encoder
:param encoder: A callable(mode, args) that returns an
ImageFile.PyEncoder object
.. versionadded:: 4.1.0
N)rs)r<>rurrr<00>register_encoder<65> s r<>cKst|f|<01>dS)N)<01>_showxv)r<>r<>rrrrt<00> srtcKs ddlm}|j||f|<02>dS)Nr)<01> ImageShow)rYr<>ru)r<>rrr<>r<>rrrr<><00> s r<>cCst<00><00>t<02>|||<02><03>S)a
Generate a Mandelbrot set covering the given extent.
:param size: The requested size in pixels, as a 2-tuple:
(width, height).
:param extent: The extent to cover, as a 4-tuple:
(x0, y0, x1, y2).
:param quality: Quality.
)r<>r<>rk<00>effect_mandelbrot)rHZextentZqualityrrrr<><00> s
r<EFBFBD>cCst<00><00>t<02>||<01><02>S)z<>
Generate Gaussian noise centered around 128.
:param size: The requested size in pixels, as a 2-tuple:
(width, height).
:param sigma: Standard deviation of noise.
)r<>r<>rk<00> effect_noise)rH<00>sigmarrrr<><00> sr<>cCst<00><00>t<02>|<00><01>S)zl
Generate 256x256 linear gradient from black to white, top to bottom.
:param mode: Input mode.
)r<>r<>rk<00>linear_gradient)rGrrrr<> sr<>cCst<00><00>t<02>|<00><01>S)zm
Generate 256x256 radial gradient from black to white, centre to edge.
:param mode: Input mode.
)r<>r<>rk<00>radial_gradient)rGrrrr<> sr<>c Cs|dkrtj}x<>dtjfdtjfdtjfgD]<5D>\}}||kr>q,||<00><06>}d}x0dD](\}}|<03>|<05>rT|}|dt|<05> <00>}qTWyt |<03>|}Wn&t
k
r<EFBFBD>t <0B> d<06> |<01><01>w,YnXy ||<03>Wq,t
k
r<EFBFBD>}zt <0B> d<07> ||<07><02>Wdd}~XYq,Xq,WdS)NZPILLOW_ALIGNMENTZPILLOW_BLOCK_SIZEZPILLOW_BLOCKS_MAXr))<02>ki)r<>iz {} is not intz{}: {})r<><00>environrkZ set_alignmentZset_block_sizeZset_blocks_maxrgr<>rQr<>r<>r<>r<>r<>)<08>env<6E>var_name<6D>setter<65>varZunitsZpostfix<69>mulrcrrr<00>_apply_env_variables s. 
 r<>c@s<>eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd"d d<0E>Z dd<10>Z
dd<12>Z dd<14>Z dd<16>Z dd<18>Zesrdd<1A>Zdd<1C>Zdd<1E>Zdd <20>Zd!S)#rrBcCsi|_i|_d|_d|_dS)N)<04>_data<74>_ifds<64>_info<66> _loaded_exif)rrrrr{B sz Exif.__init__cCs<y"t|<01>dkr t|t<02>s |dSWntk
r6YnX|S)Nrr)rQrf<00>dictr<74>)rrxrrr<00>_fixupH s  z Exif._fixupcs<00>fdd<02>|<01><00>D<00>S)Ncsi|]\}}<02><00>|<02>|<01>qSr)r<>)r<>r<>r<>)rrr<00>
<dictcomp>S sz$Exif._fixup_dict.<locals>.<dictcomp>)<01>items)rZsrc_dictr)rr<00> _fixup_dictP szExif._fixup_dictc Cs`y|j<00>||<00>Wnttfk
r,Yn0Xddlm}|<02>|j<07>}|<03>|j<00>|<00> |<03>SdS)Nr)<01>TiffImagePlugin)
r<EFBFBD>rqrir<>rYr<><00>ImageFileDirectory_v1<76>headr<64>r<>)r<00>tagr<67>r<>rrr<00> _get_ifd_dictU s   zExif._get_ifd_dictcCs<>||jkrdS||_|j<01><02>|j<03><02>d|_|s6dSt<05>|dd<00><00>|_|j<07>d<02>|_ ddl
m }|<02> |j <09>|_|jj |_|j<07>|jj<10>|j<04>|j<07>|<00>d<05>}|r<>|j<01>|<03>||jd<dS)Nr'r<>r)r<>ii<69>)r<>r<><00>clearr<72>r<>r<>r<>r<>r<>r<>rYr<>r<><00>_endian<61>endianrq<00>nextr<74>r<><00>update)rrzr<><00>ifdrrrr<>c s&


 

 z Exif.loadrcCs\ddlm}|jdkrd}nd}|j|d<06>}x|<00><04>D]\}}|||<q6Wd||<04>|<01>S)Nr)r<>rBsII*sMM*)ZifhsExif)rYr<>r<><00>ImageFileDirectory_v2r<32>r<>)rr%r<>r<>r<>r<>rxrrrr<><00> s 
  z Exif.tobytesc Cs||jk<07>r||k<06>r|dkr2|<00>|<01>|j|<<00>n<>|dk<02>rddlm}|ddd<05>dk<02>r<>|d}t|dd<07><00>}||d<00>}i}<06>x
tdt<06>d |dd
<EFBFBD><00>d<00>D]<5D>}t<06>d ||dd
|ddd
<00><00>\}} }
} y|j| \} } Wnt k
<EFBFBD>rw<>YnX|
| }|d k<04>rBt<06>d | <0B>\}||d||d<00>} n | d|<0E>} t
| <0B>|k<03>rvt <0B> d|t
| <0B>|f<00>q<>| <0B>s~q<>| |<02>| d<0F>||<q<>Wt |<00>|<06><01>|jd<<00>n\|<00>d<10>dk<02>r|d}i}<06>x2tdt<06>d|dd
<EFBFBD><00>d<00>D<00>]}t<06>d||dd
|ddd
<00><00>\}} }
} |dk<02>r<>t<06>d| <0B>\}|j<10>|<0F>d|j<10>d <0C>i}|j<10>d <0C>t|j<10>d<07><01>|d<|j<10>d <0C>|j<10>d <0C>|d<|j<10>d<07>|j<10>d <0C>}|jtjd} | |<02>|d<0F>|d<|j<10>d <0C>|j<10>d
<EFBFBD>|d<dt |<00>|<10><01>i}<06>q<>W||jd<|j<00>|i<00>S)N)i%<25>i<05>i|<7C>r)r<>r<>sFUJIFILM<4C> rz<Hr#z<HHL4sr%z<LzbPossibly corrupt EXIF MakerNote data. Expecting to read %d bytes but only got %d. Skipping tag %sFiZNintendoz>Hz>HHL4siz>LZModelIDZ TimeStampZInternalSerialNumberZParallaxZCategory)r<>r<>r<>r<>r r<>r<><00>unpackZ_load_dispatchrirQr<>r<>r<>r<>r<>r<>rqr<>r<00>FLOAT)rr<>r<>Z exif_dataZ
ifd_offsetZifd_dataZ makernoter<65>Zifd_tagrI<00>countrzZ unit_size<7A>handlerrHr%Z
camerainfoZparallaxrrr<00>get_ifd<66> sv
  &,
 (,
      
z Exif.get_ifdcCs0|jdk r&x|j<00><01>D] }||qWt|j<03>S)N)r<><00>keysrcr<>)rr<>rrr<00>__str__<5F> s
 z Exif.__str__cCs(t|j<01>}|jdk r |<01>|j<02>t|<01>S)N)<05>setr<74>r<>r<>rQ)rr<>rrr<00>__len__<5F> s

 z Exif.__len__cCs^|jdk rT||jkrT||jkrT|<00>|j|<00>|j|<|dkrL|<00>|<01>|j|<|j|=|j|S)Ni%<25>)r<>r<>r<>r<>)rr<>rrr<00> __getitem__<5F> s zExif.__getitem__cCs||jkp|jdk o||jkS)N)r<>r<>)rr<>rrr<00> __contains__<5F> szExif.__contains__cCs||kS)Nr)rr<>rrr<00>has_key<65> sz Exif.has_keycCs*|jdk r||jkr|j|=||j|<dS)N)r<>r<>)rr<>rxrrr<00> __setitem__ szExif.__setitem__cCs(|jdk r||jkr|j|=|j|=dS)N)r<>r<>)rr<>rrr<00> __delitem__ szExif.__delitem__cCs(t|j<01>}|jdk r |<01>|j<02>t|<01>S)N)r<>r<>r<>r<><00>iter)rr<>rrr<00>__iter__ s

 z Exif.__iter__N)r)rrrr<>r{r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r r<>r<>r<>r<>rrrrr? s"
Tr)r)r)r)r<>)r<>)N)r<>)N)N)N)<29><>atexitr<74><00>loggingrTr<>r<>r<>r<>r<>rYrrrrr<00>_binaryrr Z_utilr
r r r rkr<00> __builtin__<5F>collections.abcrr<00> collectionsrZ<00> getLoggerrr\r<>rr<>r<00>objectrr<>r<>rrkrjr<>rc<00>
startswithr<EFBFBD>r r<>r<><00>pathlibrrbZpathlib2r"<00>NONEZFLIP_LEFT_RIGHTZFLIP_TOP_BOTTOMrRrQrSZ TRANSPOSEZ
TRANSVERSErZr<>r<>rr}rArErBZLINEARrFrCZCUBICrDZ ANTIALIASZORDEREDZ RASTERIZEr<45>r<>r<>Z MEDIANCUTZ MAXCOVERAGEZ
FASTOCTREEZ LIBIMAGEQUANTr<54>ZSEQUENCEZ CONTAINERr(ZFILTEREDZ HUFFMAN_ONLYZRLEZFIXEDr<44>rar<>rbrjrhrhrsZ _MODEINFO<46> byteorderZ_ENDIANrFrK<00>sortedZMODESr<53>rMrNrPrRrXr[rdrqrvryrwr<>r<>r0r|r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrlr*r<>r<>r<>rr<>r<>r<>r<>r<>r<>r<>r<>r<>rtr<>r<>r<>r<>r<>r<><00>register<65> clear_cacherrrrr<00><module>s<> 

 
 
     

  .

 w 
'
&
<
9  
Z