+
    Aid                     `    R R.t ^ RIt^ RIHt ^RIHtHt R
R ltR
R lt	R t
RR ltRR	 ltR# )imreadimsaveN)Image)img_as_ubyteimg_as_uintc                    \        V \        4      '       dC   \        V R4      ;_uu_ 4       p\        P                  ! V4      p\	        WQVR7      uuRRR4       # \        P                  ! V 4      p\	        WQVR7      #   + '       g   i     R# ; i)aW  Load an image from file.

Parameters
----------
fname : str or file
    File name or file-like-object.
dtype : numpy dtype object or string specifier
    Specifies data type of array elements.
img_num : int, optional
    Specifies which image to read in a file with multiple images
    (zero-indexed).
kwargs : keyword pairs, optional
    Addition keyword arguments to pass through.

Notes
-----
Files are read using the Python Imaging Library.
See PIL docs [1]_ for a list of supported formats.

References
----------
.. [1] http://pillow.readthedocs.org/en/latest/handbook/image-file-formats.html
rb)dtypeimg_numN)
isinstancestropenr   pil_to_ndarray)fnamer	   r
   kwargsfims   &&&,  \/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/io/_plugins/pil_plugin.pyr   r   	   sh    0 %%!AB!"7C  ZZbw?? s   #A<<B	c                p    V P                  4       ^ ,           . pRp^ p	  T P                  T	4       T p
Te)   Y)8w  d#   T P                  4       ^ ,           T	^,          p	KA  T P                  R8X  d   T P                  R8X  d   Tf   RpT P                  R	8X  dp   Tf   \        T 4      pT'       d   T P                  R
4      p
MT P                  R8X  d$   RT P                  9   d   T P                  R4      p
MzT P                  R4      p
MhT P                  R8X  d   T P                  R
4      p
MERT P                  9   d   T P                  R4      p
M"T P                  R8X  d   T P                  R4      p
T P                  P                  R4      '       d   T P                  pT P                  P                  R4      '       d   RMRpRT P                  9   d   TP                  RR4      p\         P"                  ! T
P%                  4       T4      p
TRRR1,          T
n        M\         P(                  ! YR7      p
TP+                  T
4       T	^,          p	Tf   EK5   \-        T R4      '       d-   T P.                  '       d   T P.                  P1                  4        Tf'   \3        T4      ^8  d   \         P(                  ! T4      # T'       d
   T^ ,          # T'       d   \5        RT 24      hR#   \         d3   pRp\        T4      pRT P                   RT RT 2p\	        T4      hRp?ii ; i  \         d     K  i ; i)zaImport a PIL Image object to an ndarray, in memory.

Parameters
----------
Refer to ``imread``.

zLhttp://pillow.readthedocs.org/en/latest/installation.html#external-librarieszCould not load 'z' 
Reason: 'z'
Please see documentation at: NPNGIuint16PLtransparencyRGBARGB1ACMYKI;16Bz>u2z<u2Sui)r	   fpzCould not find image  #)getdataOSErrorr   filename
ValueErrorseekEOFErrorformatmode_palette_is_grayscaleconvertinfo
startswithsizeendswithreplacenp
frombuffertobytesshapearrayappendhasattrr%   closelen
IndexError)imager	   r
   esitepillow_error_messageerror_messageframes	grayscaler$   framer9   s   &&&         r   r   r   *   s   ( FI	A
	JJqM 7<MMOAFA<<5 UZZ3%65=E:: 1%8	c*<<5(^uzz-I!MM&1E!MM%0EZZ3MM#&EEJJMM&)EZZ6!MM%(E::  ((JJE"ZZ0055E5Eejj c3/MM%--/59E"+EK HHU0Ee	Qud3v;?xx	ay	27)<== 
S  (]"1vu~~. /,- .,,063 	
 ''(  		s(   K& L& &L#1-LL#&L54L5c                0   V P                   R8w  d   \        R4      h\        P                  ! V P	                  4       4      P                  R4      pV P                  4       w  r#WV^,            p\        P                  ! \        P                  ! V4      ^ 4      # )zReturn True if PIL image in palette mode is grayscale.

Parameters
----------
pil_image : PIL image
    PIL Image that is in Palette mode.

Returns
-------
is_grayscale : bool
    True if all colors in image palette are gray.
r   z$pil_image.mode must be equal to "P".)r&      )	r.   r*   r6   asarray
getpalettereshape
getextremaallclosediff)	pil_imagepalettestartstopvalid_palettes   &    r   r/   r/      sz     ~~?@@ jj--/088AG&&(KED1H-M ;;rww}-q11    c                   V P                   ^8X  d+   \        V 4      p ^R^R/V P                  ^,          ,          pMVR9   d   RpV P                  P                  R8X  d   \        V 4      p MeV P                  4       R8  d8   V P                  4       ^ 8  d#   V P                  \        P                  4      p RpM\        V 4      p M\        V 4      p Rp V P                  4       pV P                   ^8X  dA   \        P                  ! W P                   P                  4      p VP#                  VRV4       V# V P                  ^,          V P                  ^ ,          3p \        P"                  ! W%V4      pV#   \         d    T P                  4       p Li ; i  \         d    TP%                  TRT4        T# i ; i  \         d    \        P$                  ! Y%T4      p T# i ; i)	zPExport an ndarray to a PIL object.

Parameters
----------
Refer to ``imsave``.

r   r   r    r      r   raw)pngr   )ndimr   r9   r	   kindr   maxminastyper6   uint8r8   AttributeErrortostringr   newT	frombytes
fromstring)arr
format_strr.   array_bufferr   image_shapes   &&    r   ndarray_to_pilrj      s    xx1}35!V$SYYq\2	~	%99>>S c"CWWY_a**RXX&CD c"C 3&{{} xx1}YYtUU[[)	5LLud3 I yy|SYYq\2	CLAB I  &||~&  	5MM,t4 I	5  	C!!$\BBI	Cs6   E3 F F9 3FFF65F69"GGc                T   \        V \        4      '       g   Vf   Rp\        V \        4      '       d(   V P                  4       P                  R4      '       d   Rp\        P
                  ! V4      pVP                  P                  R8X  d    VP                  \        P                  4      pVP                  R	9  d   \        RVP                   24      hVP                  ^8X  d$   VP                  ^,          R
9  d   \        R4      h\        WR7      pVP                  ! V 3RV/VB  R# )a  Save an image to disk.

Parameters
----------
fname : str or file-like object
    Name of destination file.
arr : ndarray of uint8 or float
    Array (image) to save.  Arrays of data-type uint8 should have
    values in [0, 255], whereas floating-point arrays must be
    in [0, 1].
format_str : str
    Format to save as, this is defaulted to PNG if using a file-like
    object; this will be derived from the extension if fname is a string
kwargs : dict
    Keyword arguments to the Pillow save function (or tifffile save
    function, for Tiff files). These are format dependent. For example,
    Pillow's JPEG save function supports an integer ``quality`` argument
    with values in [1, 95], while TIFFFile supports a ``compress``
    integer argument with values in [0, 9].

Notes
-----
Use the Python Imaging Library.
See PIL docs [1]_ for a list of other supported formats.
All images besides single channel PNGs are converted using `img_as_uint8`.
Single Channel PNGs have the following behavior:
- Integer values in [0, 255] and Boolean types -> img_as_uint8
- Floating point and other integers -> img_as_uint16

References
----------
.. [1] http://pillow.readthedocs.org/en/latest/handbook/image-file-formats.html
Nr   z.pngbzInvalid shape for image array: z*Invalid number of channels in image array.)rg   r-   )   rI   )rI      )r   r   lowerr4   r6   
asanyarrayr	   r[   r^   r_   rZ   r*   r9   rj   save)r   rf   rg   r   imgs   &&&, r   r   r      s    F eS!!j&8
%%++-"8"8"@"@

--
C
yy~~jj"
xxv:399+FGG
xx1}99Q<v%IJJ

4CHHU0:00rU   )NN)N)__all__numpyr6   PILr   utilr   r   r   r   r/   rj   r    rU   r   <module>rx      s6   X
   -@BU>p24.b61rU   