+
    UBi                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHtHt ^RIHtHtHtHtHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RI H!t! Rt"]"'       d   ^ RI#H$t$ ^ RI
H%t%H&t& ^RIH't' ]PP                  ! ])4      t*]PV                  ! R4      PX                  t-Rt.RLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfRgRhRi/t/]PV                  ! R 4      t0]Pb                  t2 ^@]2,          t3  ! R! R"]	4      t4 ! R# R$]	4      t5R% R& lt6RjR' R( llt7 ! R) R*4      t8 ! R+ R,]94      t: ! R- R.4      t; ! R/ R0]4      t< ! R1 R2]84      t=R3 R4 lt> ! R5 R6]P"                  4      t?RRkR7RlRRmRRnRRoRRpR8RqRRqRRqRRrRRsRRtRRuRRvRRw/t@R9 R: ltA ! R; R<4      tB ! R= R>4      tC ! R? R@]4      tDRA RB ltERC RD ltF]AR3RE RF lltGRG RH ltH]P                  ! ]?P                  ]?]>4       ]P                  ! ]?P                  ]G4       ]P                  ! ]?P                  ]F4       ]P                  ! ]?P                  RIRJ.4       ]P                  ! ]?P                  RK4       R# )x    )annotationsN)IntEnum)IO
NamedTuplecast)Image
ImageChops	ImageFileImagePaletteImageSequence)i16be)i32be)o8)o16be)o32be)	deprecate)DeferredErrorF)Callable)AnyNoReturn)_imagings   \w\w\w\ws   PNG

1LL;2L;4I;16I;16BRGBPP;1P;2P;4LARGBAs   ^* *$c                  &    ] tR t^mt^ t ^t ^tRtR# )Disposal N)__name__
__module____qualname____firstlineno__OP_NONEOP_BACKGROUNDOP_PREVIOUS__static_attributes__r'       7/usr/lib/python3.14/site-packages/PIL/PngImagePlugin.pyr&   r&   m   s$    G M
 Kr0   r&   c                       ] tR t^t^ t ^tRtR# )Blendr'   N)r(   r)   r*   r+   	OP_SOURCEOP_OVERr/   r'   r0   r1   r3   r3      s    I
 Gr0   r3   c                    V ^8  d   QhRRRR/# )   sbytesreturnr'   )formats   "r1   __annotate__r<      s      U u r0   c                    \         P                  ! 4       pVP                  V \        4      pVP                  '       d   R p\        V4      hV# )z=Decompressed data too large for PngImagePlugin.MAX_TEXT_CHUNK)zlibdecompressobj
decompressMAX_TEXT_CHUNKunconsumed_tail
ValueError)r8   dobj	plaintextmsgs   &   r1   _safe_zlib_decompressrG      sA    D>2IMor0   c               $    V ^8  d   QhRRRRRR/# )r7   datar9   seedintr:   r'   )r;   s   "r1   r<   r<      s!     / / /c /# /r0   c                <    \         P                  ! W4      R ,          # )l    )r>   crc32)rI   rJ   s   &&r1   _crc32rN      s    ::d!J..r0   c                      ] tR t^tR R ltR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRR R lltRtR# )ChunkStreamc                    V ^8  d   QhRRRR/# r7   fp	IO[bytes]r:   Noner'   )r;   s   "r1   r<   ChunkStream.__annotate__   s     = =9 = =r0   c                	     Wn         . V n        R # NrS   queue)selfrS   s   &&r1   __init__ChunkStream.__init__   s    $&:<
r0   c                   V ^8  d   QhRR/# )r7   r:   ztuple[bytes, int, int]r'   )r;   s   "r1   r<   rV      s        ,  r0   c                   RpV P                   f   Q hV P                  '       d:   V P                  P                  4       w  rpV P                   P                  V4       MIV P                   P	                  ^4      pVR,          pV P                   P                  4       p\        V4      p\        V4      '       g1   \        P                  '       g   R\        V4       R2p\        V4      hWV3# )z.Fetch a new chunk. Returns header information.N:   NNzbroken PNG file (chunk ))rS   rZ   popseekreadtelli32is_cidr
   LOAD_TRUNCATED_IMAGESreprSyntaxError)r[   cidposlengthr8   rF   s   &     r1   rd   ChunkStream.read   s    ww""":::#zz~~/CfGGLLQAB%C'',,.CVFc{{222/S	{!<!#&&r0   c                   V ^8  d   QhRR/# )r7   r:   rP   r'   )r;   s   "r1   r<   rV      s      ; r0   c                	    V # rX   r'   r[   s   &r1   	__enter__ChunkStream.__enter__   s    r0   c                    V ^8  d   QhRRRR/# )r7   argsobjectr:   rU   r'   )r;   s   "r1   r<   rV      s      f  r0   c                	&    V P                  4        R # rX   )close)r[   ru   s   &*r1   __exit__ChunkStream.__exit__   s    

r0   c                   V ^8  d   QhRR/# r7   r:   rU   r'   )r;   s   "r1   r<   rV      s     $ $t $r0   c                	"    R ;V n         V n        R # rX   )rZ   rS   rq   s   &r1   rx   ChunkStream.close   s    ##
TWr0   c               (    V ^8  d   QhRRRRRRRR/# )r7   rk   r9   rl   rK   rm   r:   rU   r'   )r;   s   "r1   r<   rV      s(     . . .C . . .r0   c                	`    V P                   f   Q hV P                   P                  WV34       R # rX   )rZ   appendr[   rk   rl   rm   s   &&&&r1   pushChunkStream.push   s)    zz%%%

3V,-r0   c               (    V ^8  d   QhRRRRRRRR/# )r7   rk   r9   rl   rK   rm   r:   r'   )r;   s   "r1   r<   rV      s.     J J JC J J Jr0   c                x    \         P                  RWV4       \        V RVP                  R4       24      ! W#4      # )z"Call the appropriate chunk handlerzSTREAM %r %s %schunk_ascii)loggerdebuggetattrdecoder   s   &&&&r1   callChunkStream.call   s8     	&&9tvcjj&9%:;<SIIr0   c               $    V ^8  d   QhRRRRRR/# r7   rk   r9   rI   r:   rU   r'   )r;   s   "r1   r<   rV      s!     * *u *E *d *r0   c                   \         P                  '       d1   V^ ,          ^,	          ^,          '       d   V P                  W4       R# V P                  f   Q h \	        V\	        V4      4      p\        V P                  P                  ^4      4      pW48w  d   R\        V4       R2p\        V4      hR#   \        P                   d!   pR\        T4       R2p\        T4      ThRp?ii ; i)zRead and verify checksumNz(broken PNG file (bad header checksum in ra   z(broken PNG file (incomplete checksum in )r
   rh   crc_skiprS   rN   rf   rd   ri   rj   structerror)r[   rk   rI   crc1crc2rF   es   &&&    r1   crcChunkStream.crc   s     ***A!aMM#$ww"""	*$s,Dtww||A'D|@c1M!#&&  || 	*<T#YKqICc")	*s   AB3 3C(C##C(c               $    V ^8  d   QhRRRRRR/# r   r'   )r;   s   "r1   r<   rV      s!      E  4 r0   c                \    V P                   f   Q hV P                   P                  ^4       R# )zRead checksumN)rS   rd   )r[   rk   rI   s   &&&r1   r   ChunkStream.crc_skip   s#     ww"""Qr0   c                    V ^8  d   QhRRRR/# )r7   endchunkr9   r:   zlist[bytes]r'   )r;   s   "r1   r<   rV      s      u ; r0   c                	@   . pV P                   f   Q h  V P                  4       w  r4pY18X  d    T# T P                  T\        P                  ! T P                   T4      4       TP                  T4       Kb    \        P                   d   pRp\	        T4      ThR p?ii ; i)Nztruncated PNG file)	rS   rd   r   r   OSErrorr   r
   
_safe_readr   )r[   r   cidsrk   rl   rm   r   rF   s   &&      r1   verifyChunkStream.verify   s     ww"""*#'99; &
   HHS)..tww?@KK << **cl)*s   A5 5B
BBrY   N)   IEND)r(   r)   r*   r+   r\   rd   rr   ry   rx   r   r   r   r   r   r/   r'   r0   r1   rP   rP      s:    = *$.J** r0   rP   c                  J    ] tR t^t$ RtR]R&   R]R&   ]R	R R ll4       tRtR# )
iTXtze
Subclass of string to allow iTXt chunks to look like strings while
keeping their extra information

zstr | bytes | NonelangtkeyNc               (    V ^8  d   QhRRRRRRRR/# )r7   textstrr   z
str | Noner   r:   r   r'   )r;   s   "r1   r<   iTXt.__annotate__
  s,      (7A	r0   c                H    \         P                  W4      pW$n        W4n        V# )z
:param cls: the class to use when creating the instance
:param text: value for this key
:param lang: language code
:param tkey: UTF-8 version of the key name
)r   __new__r   r   )clsr   r   r   r[   s   &&&& r1   r   iTXt.__new__	  s!     {{3%		r0   )r   r   )NN)	r(   r)   r*   r+   __doc____annotations__staticmethodr   r/   r'   r0   r1   r   r      s'     
 r0   r   c                  V    ] tR tRtRtR R ltRR R lltRR R lltRR	 R
 lltRt	R# )PngInfoi  z4
PNG chunk container (for use with save(pnginfo=))

c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   PngInfo.__annotate__   s     : :$ :r0   c                	    . V n         R # rX   chunksrq   s   &r1   r\   PngInfo.__init__   s	    79r0   c               (    V ^8  d   QhRRRRRRRR/# )r7   rk   r9   rI   
after_idatboolr:   rU   r'   )r;   s   "r1   r<   r   #  s(     
4 
4u 
4E 
4t 
4 
4r0   c                @    V P                   P                  WV34       R# )zAppends an arbitrary chunk. Use with caution.

:param cid: a byte string, 4 bytes long.
:param data: a byte string of the encoded data
:param after_idat: for use with private chunks. Whether the chunk
                   should be written after IDAT

N)r   r   )r[   rk   rI   r   s   &&&&r1   addPngInfo.add#  s     	Cz23r0   c               0    V ^8  d   QhRRRRRRRRRRRR	/# )
r7   keystr | bytesvaluer   r   zipr   r:   rU   r'   )r;   s   "r1   r<   r   /  sN     !U !U!U !U 	!U
 !U !U 
!Ur0   c                r   \        V\        4      '       g   VP                  RR4      p\        V\        4      '       g   VP                  RR4      p\        V\        4      '       g   VP                  RR4      p\        V\        4      '       g   VP                  RR4      pV'       dS   V P                  RVR,           V,           R,           V,           R,           \        P
                  ! V4      ,           4       R# V P                  RVR,           V,           R,           V,           R,           V,           4       R# )	zAppends an iTXt chunk.

:param key: latin-1 encodable text key name
:param value: value for this key
:param lang: language code
:param tkey: UTF-8 version of the key name
:param zip: compression flag

latin-1strictutf-8   iTXts         s      N)
isinstancer9   encoder   r>   compress)r[   r   r   r   r   r   s   &&&&&&r1   add_itxtPngInfo.add_itxt/  s    $ #u%%**Y1C%''LL(3E$&&;;w1D$&&;;w1DHHk!D(5047%?$--PUBVV
 HHWcIo4u<tCeKeSTr0   c               (    V ^8  d   QhRRRRRRRR/# )	r7   r   r   r   zstr | bytes | iTXtr   r   r:   rU   r'   )r;   s   "r1   r<   r   R  s,     !3 !3!3'9!3@D!3	!3r0   c                x   \        V\        4      '       dQ   T P                  TTVP                  e   VP                  MRVP                  e   VP                  VR7      # RVR7      # \        V\
        4      '       g    VP                  RR4      p\        V\
        4      '       g   VP                  RR4      pV'       d7   V P                  RVR,           \        P                  ! V4      ,           4       R# V P                  RVR	,           V,           4       R#   \         d    T P                  YTR7      u # i ; i)
zAppends a text chunk.

:param key: latin-1 encodable text key name
:param value: value for this key, text or an
   :py:class:`PIL.PngImagePlugin.iTXt` instance
:param zip: compression flag

Nr0   )r   r   r      zTXt        tEXtr   )r   r   r   r   r   r9   r   UnicodeErrorr   r>   r   )r[   r   r   r   s   &&&&r1   add_textPngInfo.add_textR  s
    eT""==#jj4

##jj4

 !   ;> !   %'':Y9 #u%%**Y1CHHWcGmdmmE.BBCHHWcEkE12   :}}SS}99:s   >D D98D9r   NF) r   F)
r(   r)   r*   r+   r   r\   r   r   r   r/   r'   r0   r1   r   r     s"    
:
4!UF!3 !3r0   r   c                  6    ] tR tRt$ R]R&   R]R&   R]R&   RtR	# )
_RewindStateiz  z dict[str | tuple[int, int], Any]infozlist[ImageFile._Tile]tilez
int | Noneseq_numr'   Nr(   r)   r*   r+   r   r/   r'   r0   r1   r   r   z  s    
**
r0   r   c                    a  ] tR tRtR V 3R lltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR,tV ;t# )-	PngStreami  c                    V ^8  d   QhRRRR/# rR   r'   )r;   s   "r1   r<   PngStream.__annotate__  s      9  r0   c                	   < \         SV `  V4       / V n        / V n        RV n        RV n        . V n        RV n        RV n        RV n	        RV n
        \        / . R4      V n        ^ V n        R# )r   r   Nr   r   )superr\   im_infoim_textim_sizeim_modeim_tile
im_paletteim_custom_mimetypeim_n_frames_seq_numr   rewind_statetext_memory)r[   rS   	__class__s   &&r1   r\   PngStream.__init__  sl     :<.0.048.2'+$((R6r0   c                    V ^8  d   QhRRRR/# )r7   chunklenrK   r:   rU   r'   )r;   s   "r1   r<   r     s     " "# "$ "r0   c                	    V ;P                   V,          un         V P                   \        8  d   R V P                    R2p\        V4      hR# )z%Too much memory used in text chunks: z>MAX_TEXT_MEMORYN)r   MAX_TEXT_MEMORYrC   )r[   r   rF   s   && r1   check_text_memoryPngStream.check_text_memory  sN    H$o-7##$$46  S/! .r0   c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   r     s     
 
T 
r0   c                	    \        V P                  P                  4       V P                  V P                  4      V n        R # rX   )r   r   copyr   r   r   rq   s   &r1   save_rewindPngStream.save_rewind  s-    (LLLLMM
r0   c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   r     s     2 2 2r0   c                	    V P                   P                  P                  4       V n        V P                   P                  V n        V P                   P                  V n        R # rX   )r   r   r   r   r   r   r   r   rq   s   &r1   rewindPngStream.rewind  sD    ((--224((--))11r0   c               $    V ^8  d   QhRRRRRR/# r7   rl   rK   rm   r:   r9   r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	    V P                   f   Q h\        P                  ! V P                   V4      pVP                  R4      p\        P                  RVR V 4       W4^,           ,          p\        P                  RV4       V^ 8w  d   RV R2p\        V4      h \        W4^,           R  4      pYpP                  R&   T#   \         d    \        P                  '       d   R p L5h \        P                   d    R p LNi ; i)Nr   ziCCP profile name %rzCompression method %sUnknown compression method z in iCCP chunkicc_profile)rS   r
   r   findr   r   rj   rG   rC   rh   r>   r   r   )r[   rl   rm   r8   icomp_methodrF   r
  s   &&&     r1   
chunk_iCCPPngStream.chunk_iCCP  s    ww"""  &1 FF5M+QrU3Ah,k:!/}NKCc""	/a%'
;K '2]#  	..."zz 	K	s$   B> > C=C=#C=7C=<C=c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     !      c 3 5 r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      pV^8  d&   \        P                  '       d   V# Rp\	        V4      h\        V^ 4      \        V^4      3V n         \        V^,          V^	,          3,          w  V n        V n	        V^,          '       d   ^V P                  R&   V^,          '       d   Rp\        V4      hV#   \         d     LIi ; i)NzTruncated IHDR chunk	interlacezunknown filter category)rS   r
   r   rh   rC   rf   r   _MODESr   
im_rawmode	Exceptionr   rj   r[   rl   rm   r8   rF   s   &&&  r1   
chunk_IHDRPngStream.chunk_IHDR  s    ww"""  &1B;...(CS/!1ay#a)+	,2AaD!A$<,@)DL$/ R55()DLL%R55+Cc""  		s   <*C" "C0/C0c               $    V ^8  d   QhRRRRRR/# r7   rl   rK   rm   r:   r   r'   )r;   s   "r1   r<   r     s!      c 3 8 r0   c                	b   R V P                   9   d6   \        P                  ! RV P                   R ,          WP                  4      .pMQV P                  e   RV P                   R&   \        P                  ! RRV P
                  ,           WP                  4      .pW0n        W n        Rp\        V4      h)bboxr   Tdefault_imagezimage data foundr   )	r   r
   _Tiler  r   r   r   im_idatEOFError)r[   rl   rm   r   rF   s   &&&  r1   
chunk_IDATPngStream.chunk_IDAT  s    T\\!OOE4<<+?ooVWD+04_-OOE6DLL+@#WXD smr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 8 r0   c                	    R p\        V4      h)zend of PNG image)r!  )r[   rl   rm   rF   s   &&& r1   
chunk_IENDPngStream.chunk_IEND  s     smr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	    V P                   f   Q h\        P                  ! V P                   V4      pV P                  R8X  d
   RV3V n        V# )Nr   r   )rS   r
   r   r   r   r[   rl   rm   r8   s   &&& r1   
chunk_PLTEPngStream.chunk_PLTE  sD    ww"""  &1<<3#QhDOr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     r  r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      pV P                  R8X  dU   \        P                  V4      '       d)   VP                  R4      pV^ 8  d   W@P                  R&   V# W0P                  R&    V# V P                  R9   d   \        V4      V P                  R&   V# V P                  R8X  d0   \        V4      \        V^4      \        V^4      3V P                  R&   V# )Nr   r   transparencyr   )r   r   r   )	rS   r
   r   r   _simple_palettematchr  r   i16)r[   rl   rm   r8   r  s   &&&  r1   
chunk_tRNSPngStream.chunk_tRNS  s    ww"""  &1<<3$$Q'' FF5M634LL0  01^,
 	 \\//+.q6DLL(  \\U"+.q63q!9c!Qi+GDLL(r0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	    V P                   f   Q h\        P                  ! V P                   V4      p\        V4      R,          V P                  R&   V# )N     j@gamma)rS   r
   r   rf   r   r*  s   &&& r1   
chunk_gAMAPngStream.chunk_gAMA  sD    ww"""  &1 #A 1Wr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	0   V P                   f   Q h\        P                  ! V P                   V4      p\        P                  ! R\        V4      ^,           R2V4      p\        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      V P                  R&   V# )N>Ic              3  2   "   T F  qR ,          x  K  	  R# 5i)r7  Nr'   ).0elts   & r1   	<genexpr>'PngStream.chunk_cHRM.<locals>.<genexpr>  s     ,Px8^^xs   chromaticity)rS   r
   r   r   unpacklentupler   )r[   rl   rm   r8   raw_valss   &&&  r1   
chunk_cHRMPngStream.chunk_cHRM  sw     ww"""  &1==1SVq[M!3Q7',u,Px,Puu,Px,P'P^$r0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	    V P                   f   Q h\        P                  ! V P                   V4      pV^8  d&   \        P                  '       d   V# Rp\	        V4      hV^ ,          V P
                  R&   V# )NzTruncated sRGB chunksrgb)rS   r
   r   rh   rC   r   r  s   &&&  r1   
chunk_sRGBPngStream.chunk_sRGB  sh     ww"""  &1A:...(CS/! tVr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r   (  s!      c 3 5 r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      pV^	8  d&   \        P                  '       d   V# Rp\	        V4      h\        V^ 4      \        V^4      reV^,          pV^8X  d#   VR,          VR,          3pWP                  R&   V# V^ 8X  d   WV3V P                  R&   V# )NzTruncated pHYs chunk
F%u?dpiaspect)rS   r
   r   rh   rC   rf   r   )	r[   rl   rm   r8   rF   pxpyunitrS  s	   &&&      r1   
chunk_pHYsPngStream.chunk_pHYs(  s    ww"""  &1A:...(CS/!QC1IBt19v+rF{*C"%LL  QY%'VDLL"r0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r   :  s!      c 3 5 r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      p VP                  R^4      w  rEV'       de   VP                  RR4      pVP                  RR4      pVR8X  d   TMTV P                  V&   WpP                  V&   V P                  \        V4      4       V#   \         d    TpRp Li ; i)Nr   r0   r   r   replaces   exif)
rS   r
   r   splitrC   r   r   r   r   rF  )r[   rl   rm   r8   kvk_strv_strs   &&&     r1   
chunk_tEXtPngStream.chunk_tEXt:  s    ww"""  &1	775!$DA
 HHY1EHHY	2E'(G|!DLL"'LL""3u:.  	AA	s   B5 5CCc               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r   N  s!     ! !c !3 !5 !r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      p VP                  R^4      w  rEV'       d   V^ ,          pM^ pV^ 8w  d   RV R2p\        V4      h \        VR,          4      pT'       d]   TP                  RR4      pTP                  RR4      p	T	;T P                  T&   T P                  T&   T P                  \        T	4      4       T#   \         d    TpRp Li ; i  \         d    \        P                  '       d   Rp Lh \        P                   d    Rp Li ; i)	Nr   r0   r	  z in zTXt chunk:   NNr   r   r\  )rS   r
   r   r]  rC   rj   rG   rh   r>   r   r   r   r   r   rF  )
r[   rl   rm   r8   r^  r_  r  rF   r`  ra  s
   &&&       r1   
chunk_zTXtPngStream.chunk_zTXtN  s.   ww"""  &1	775!$DA A$KK!/}NKCc""	%ae,A HHY1EHHY	2E8==DLL$,,u"5""3u:.7  	AA	  	...zz 	A	s5   C, 4D ,C>=C> E "E &E :E ?E c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r   q  s!     ) )c )3 )5 )r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      ;r4 VP                  R^4      w  rS\        T4      ^8  d   T# T^ ,          T^,          TR,          r7p TP                  R^4      w  rp
T^ 8w  d   T^ 8X  d    \        T
4      p
MT# TR8X  d   YP                  R&    TP                  RR4      pTP                  RR4      pT	P                  RR4      pT
P                  RR4      p\        YT4      ;T P                  T&   T P                  T&   T P                  \        T4      4       T#   \         d    Tu # i ; i  \         d    Tu # i ; i  \         d    \        P                  '       d   Tu # h \        P                   d    Tu # i ; i  \         d    Tu # i ; i)Nr   :r7   NNs   XML:com.adobe.xmpxmpr   r   r   )rS   r
   r   r]  rC   rF  rG   rh   r>   r   r   r   r   r   r   r   )r[   rl   rm   rr8   r^  cfcmr   tkr_  r`  lang_strtk_strra  s   &&&            r1   
chunk_iTXtPngStream.chunk_iTXtq  s   ww"""$$TWWf55	775!$DA q6A:HaD!A$"	''%+KDa 7Qw-a0A $$"#LL	HHY1E{{7H5HYYw1FHHWh/E 59&4QQUdll51s5z*G  	H	  	H	 "  666 zz H  	H	sZ   E	 5E E/ =AF1 	EEE,+E,/ F.F.F.(F.-F.1G Gc               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	    V P                   f   Q h\        P                  ! V P                   V4      pRV,           V P                  R&   V# )N   Exif  exif)rS   r
   r   r   r*  s   &&& r1   
chunk_eXIfPngStream.chunk_eXIf  s@    ww"""  &1.2Vr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     r  r0   c                	   V P                   f   Q h\        P                  ! V P                   V4      pV^8  d&   \        P                  '       d   V# Rp\	        V4      hV P
                  e    R V n        \        P                  ! R4       V# \        V4      pV^ 8X  g   VR8  d   \        P                  ! R4       V# WPn        \        V^4      V P                  R&   RV n
        V# )Nz"APNG contains truncated acTL chunkz4Invalid APNG, will use default PNG image if possiblel        loopz
image/apng)rS   r
   r   rh   rC   r   warningswarnrf   r   r   )r[   rl   rm   r8   rF   n_framess   &&&   r1   
chunk_acTLPngStream.chunk_acTL  s    ww"""  &1A:...6CS/!'#DMMPQHq6q=Hz1MMPQH#"1ayV".r0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!      c 3 5 r0   c                	j   V P                   f   Q h\        P                  ! V P                   V4      pV^8  d&   \        P                  '       d   V# Rp\	        V4      h\        V4      pV P                  f   V^ 8w  g'   V P                  e&   V P                  V^,
          8w  d   Rp\        V4      hWPn        \        V^4      \        V^4      rv\        V^4      \        V^4      rV P                  w  rW,           V
8  g   W,           V8  d   Rp\        V4      hWW,           W,           3V P                  R&   \        V^4      \        V^4      rV^ 8X  d   ^dp\        V4      \        V4      ,          R,          V P                  R&   V^,          V P                  R&   V^,          V P                  R&   V# )	Nz"APNG contains truncated fcTL chunk#APNG contains frame sequence errorszAPNG contains invalid framesr    durationdisposalblend)rS   r
   r   rh   rC   rf   r   rj   r   r   r2  float)r[   rl   rm   r8   rF   seqwidthheightrU  rV  im_wim_h	delay_num	delay_dens   &&&           r1   
chunk_fcTLPngStream.chunk_fcTL  sm   ww"""  &1B;...6CS/!!fMM!cQhMM%$--37*B7Cc""Aq	3q!9vQSBZB\\
:d 20Cc"" "
BK@V"1bz3q":9>I#(#3eI6F#F#MZ #$R5Z  !"Wr0   c               $    V ^8  d   QhRRRRRR/# r  r'   )r;   s   "r1   r<   r     s!     4 4c 43 45 4r0   c                	   V P                   f   Q hV^8  dG   \        P                  '       d$   \        P                  ! V P                   V4      pV# Rp\	        V4      h\        P                  ! V P                   ^4      p\        V4      pV P                  V^,
          8w  d   Rp\        V4      hWPn        V P                  V^,           V^,
          4      # )Nz"APNG contains truncated fDAT chunkr  )	rS   r
   rh   r   rC   rf   r   rj   r"  )r[   rl   rm   r8   rF   r  s   &&&   r1   
chunk_fdATPngStream.chunk_fdAT  s    ww"""A:...((&96CS/!  !,!f==C!G#7Cc""sQw
33r0   )r   r   r   r   r   r   r   r  r   r   r   r   r   )r(   r)   r*   r+   r\   r   r   r  r  r  r"  r&  r+  r3  r9  rI  rN  rX  rb  rg  rr  rx  r  r  r  r/   __classcell__r   s   @r1   r   r     sx     ""
2
8**"$(!F)V*<4 4r0   r   c                    V ^8  d   QhRRRR/# )r7   prefixr9   r:   r   r'   )r;   s   "r1   r<   r<     s     % %E %d %r0   c                ,    V P                  \        4      # rX   )
startswith_MAGIC)r  s   &r1   _acceptr    s    V$$r0   c                     a  ] tR tRtRtRtR R lt]R R l4       tR R	 lt	R
 R lt
RR R lltR R ltR R ltR R ltR R ltR R ltR V 3R lltRtV ;t# )PngImageFilei  PNGzPortable network graphicsc                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   PngImageFile.__annotate__  s     A- A-t A-r0   c                	   \        V P                  P                  ^4      4      '       g   Rp\        V4      hV P                  V n        ^ V n        . V n        \        V P                  4      V n         V P                  P                  4       w  r#p V P                  P                  W#V4      pT P                  P%                  Y%4       KX    \         d     M\         du    \        P                  RY#T4       \        P                  ! T P                  T4      pTR,          P!                  4       '       d   T P                  P#                  Y%34        Li ; iT P                  P&                  T n        T P                  P*                  T n        T P                  P.                  T n        RT n        T P                  P4                  T n        T P                  P8                  T n        T P                  P<                  ;'       g    ^T n        T P0                  PA                  RR4      T n!        T P                  PD                  '       d4   T P                  PD                  w  rg\F        PH                  ! Yg4      T n%        TR8X  d   T^,
          T n&        MY@n&        T P                  P<                  e   RT n'        T P                  PQ                  4        T PL                  T n)        T P                  PU                  4       T n+        T PB                  '       d   T ;P>                  ^,          un        T PY                  ^ 4       T P>                  ^8  T n-        R# )   znot a PNG file%r %s %s (unknown)rf  r7   NNr  F   fdAT).r  rS   rd   rj   _fp_PngImageFile__frameprivate_chunksr   pngr   r!  AttributeErrorr   r   r
   r   islowerr   r   r   _moder   _sizer   r   _textr   r   r   custom_mimetyper   r  getr  r   r   rawpalette_PngImageFile__prepare_idat!_close_exclusive_fp_after_loadingr   _PngImageFile__rewind_idatre   _PngImageFile__rewind_seekis_animated)r[   rF   rk   rl   rm   r8   rawmoderI   s   &       r1   _openPngImageFile._open  s`   tww||A''"Cc""77
 VX%.tww%7  $xx}}Cf9HHMM#F3 HHLL   ! 913VD((&9s8##%%''..x8	9 XX%%
XX%%
HH$$	37
HH$$	#xx::,,11!YY]]?EB88 HH//MG'++G:DL'>"(1*D"(88+5:D2HH  "!%!4!4D HHMMODM!!!"JJqM==1,s   C	 	EEA2EEc                   V ^8  d   QhRR/# )r7   r:   zdict[str, str | iTXt]r'   )r;   s   "r1   r<   r  ;  s      + r0   c                	<   V P                   ft   V P                  '       d/   V P                  pV P                  V P                  ^,
          4       V P                  4        V P                  '       d   V P                  X4       V P                   f   Q hV P                   # rX   )r  r  r  rc   r  load)r[   frames   & r1   r   PngImageFile.text:  su     :: 		$--!+,IIK		% zz%%%zzr0   c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   r  J  s       r0   c                   V P                   f   Rp\        V4      hV P                   P                  V P                  ^ ,          ^,          ^,
          4       V P                  f   Q hV P                  P                  4        V P                  P                  4        V P                  '       d   V P                   P                  4        RV n         R# )zVerify PNG fileNz)verify must be called directly after open)rS   RuntimeErrorrc   r   r  r   rx   _exclusive_fp)r[   rF   s   & r1   r   PngImageFile.verifyJ  s     77?=Cs## 	TYYq\!_q()xx###GGMMOr0   c                    V ^8  d   QhRRRR/# )r7   r  rK   r:   rU   r'   )r;   s   "r1   r<   r  \  s     + +# +$ +r0   c                	r   V P                  V4      '       g   R # WP                  8  d   V P                  ^ R4       V P                  p\        V P                  ^,           V^,           4       F  p V P                  V4       K  	  R #   \         d%   pT P                  T4       Rp\	        T4      ThR p?ii ; i)NTzno more images in APNG file)_seek_checkr  r  ranger!  rc   )r[   r  
last_framefr   rF   s   &&    r1   rc   PngImageFile.seek\  s    &&<<JJq$\\
t||a'3A+

1 4  +		*%3sm*+s   0BB6B11B6c               $    V ^8  d   QhRRRRRR/# )r7   r  rK   r  r   r:   rU   r'   )r;   s   "r1   r<   r  k  s+     bI bI3 bI bI bIr0   c                	   V P                   f   Q h\        V P                  \        4      '       d   V P                  P                  hV  R pV^ 8X  Ed:   V'       d   V P                  P                  V P                  4       V P                   P                  4        V P                  V n	        R V n
        V P                   P                  V n        V P                   P                  V n        V P                  V n        R V n        R V n        V P                  P%                  RR4      V n        V P                  P%                  R4      V n        V P                  P%                  R4      V n        V P                  P%                  R4      p^ V n        EMzWP,                  ^,           8w  d   RV 2p\/        V4      hV P1                  4        V P"                  '       d1   V P2                  P5                  V P"                  V P6                  4       V P2                  P9                  4       V n        V P                  V n        V P                  '       d3   \:        P<                  ! V P                  V P                  4       ^ V n	        Rp V P                  P?                  ^4        V P                   P?                  4       w  rgpTR8X  d   R	p\G        T4      hTR
8X  d   T'       d   Rp\E        T4      hRp T P                   PI                  YgT4       K  V'       d   W0n        V P                   f5   V P(                  \R        PT                  8X  d   \R        PV                  V n        R V n        V P(                  \R        PT                  8X  da   V P                   '       dM   V P                   P9                  4       V n        V PY                  V P"                  V P6                  4      V n        R # R # V P(                  \R        PV                  8X  dg   \Z        P\                  P_                  V P`                  V Pb                  4      V n        V PY                  V P"                  V P6                  4      V n        R # R #   \@        PB                  \D        3 d     Mi ; i  \J         d     M\F         dG    TR8X  d   T^,          pT'       d	   Yn	         Mo\:        P<                  ! T P                  T4        EKe  \L         d>    \N        PQ                  RYgT4       \:        P<                  ! T P                  T4        EK  i ; iYn        T P                   P                  T n        T P                  P%                  R4      T n        T P                  P%                  R4      T n        T P                  P%                  R4      pT P                  '       d   EK  Rp\G        T4      h)Nr  Fr  r  r  zcannot seek to frame Tr   zNo more images in APNG file   fcTLzAPNG missing frame datar  r  zimage not found in APNG frame)2r  r   r  r   exrc   r  r  r  r  _imr   r   r   r   rS   _prev_imdisposer  r  
dispose_opblend_opr  rC   r  impastedispose_extentr   r
   r   rd   r   r   rj   r!  r   UnicodeDecodeErrorr  r   r   r&   r.   r-   _cropr   corefillmodesize)	r[   r  r  r  rF   frame_startrk   rl   rm   s	   &&&      r1   r  PngImageFile._seekk  s   xx###dhh..((++A:dmm,!&*&8&8# HH,,	 HH,,	(( DMDL!%!FD"iimmJ7DO IIMM'2DM!YY]]62NDLq((-eW5 o% IIK|||dllD,?,?@ GGLLNDMhhDG """$$TWWd.A.AB&'#KQ'+xx}}$Cf '>7C"3-''>"7)#.."&K:HHMM#F3. ES == T__8L8L%L&44DO??h222}}}#}}113#zz$,,8K8KL  __ 6 66 ::??499dii@DL::dllD4G4GHDL 7c k2  *  :g~!&28/!((&99% :LL!5sH((&99: !L((DI"iimmJ7DO IIMM'2DM!YY]]62N9995sm#sH   Q# (R #R RT'T'T'3T';!T' T')9T'&T'c                   V ^8  d   QhRR/# )r7   r:   rK   r'   )r;   s   "r1   r<   r    s      c r0   c                	    V P                   # rX   )r  rq   s   &r1   re   PngImageFile.tell  s    ||r0   c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   r    s     / /d /r0   c                    V P                   P                  R4      '       d   V P                  R,           V n        V P                  V n        \
        P
                  P                  V 4       R# )z"internal: prepare to read PNG filer  N)rf  )r   r  decoderconfigr  _PngImageFile__idatr
   load_preparerq   s   &r1   r  PngImageFile.load_prepare  sK     99==%%!%!3!3d!:D))((.r0   c                    V ^8  d   QhRRRR/# )r7   
read_bytesrK   r:   r9   r'   )r;   s   "r1   r<   r    s      (  (C  (E  (r0   c                P   V P                   f   Q hV P                  ^ 8X  d   V P                  P                  ^4       V P                   P                  4       w  r#pVR9  d   V P                   P	                  W#V4       R# VR8X  d.    V P                   P                  W#V4       V^,
          V n        K  W@n        K  V^ 8:  d   V P                  pM\        WP                  4      pV P                  V,
          V n        V P                  P                  V4      #   \         d     Li ; i)zinternal: read more image datar  r0   )   IDATs   DDATr  )r  r  rS   rd   r   r   r!  min)r[   r  rk   rl   rm   s   &&   r1   	load_readPngImageFile.load_read  s     xx###kkQ GGLLO#xx}}Cf55c/g~HHMM#F3 %qj$ ?JZ5JkkJ.ww||J''   s   D D%$D%c                   V ^8  d   QhRR/# r|   r'   )r;   s   "r1   r<   r    s     <( <($ <(r0   c                   V P                   f   Q hV P                  ^ 8w  d&   V P                  P                  V P                  4        V P                  P                  ^4        V P                   P                  4       w  rpTR8X  d   M\TR8X  d7   T P                  '       d%   ^ T n        T P                   P                  YT4       M T P                   P                  YT4       K  T P                   P.                  T n        T P                  '       g$   T P                   P3                  4        RT n         R# T P4                  '       Edq   T P6                  \8        P:                  8X  EdO   T P=                  T P>                  T P@                  4      pT P>                  PB                  R8X  d6   R	T PD                  9   d%   TPG                  R
T PD                  R	,          4      pMT P>                  PB                  R8X  dt   R	T PD                  9   dc   T PD                  R	,          p\I        T\J        4      '       d   TPM                  T4       M'\I        T\N        4      '       d   TPQ                  T4       TPS                  R
4      pT P4                  PU                  Y`P@                  T4       T P4                  T n        R# R# R#   \        P
                  \        3 d     EK  i ; i  \         d     EK  \         dk    TR8X  d
   T^,          p \        P                  ! T P                  T4        EK    \         d&   p\        P                   '       d	    Rp? EKp  ThRp?ii ; i\"         d|    \$        P'                  RYT4       \        P                  ! T P                  T4      pTR,          P)                  4       '       d"   T P*                  P-                  YR34        EK   EK  i ; i)z%internal: finished reading image dataNTr   r  r  r  r  r   r/  r$   r   )+r  r  rS   rd   r   r   rj   r  r  r   r   r  r!  r
   r   r   rh   r  r   r   r  r  r   r   r  rx   r  r  r3   r5   r  r  r  r  r   convert_transparentr   r9   putpalettealphasrK   putpalettealphaconvertr  )	r[   rk   rl   rm   r   r8   updatedmaskts	   &        r1   load_endPngImageFile.load_end  s   xx###;;!GGLL%GGLLO#'88==? & g~D$4$4$4&'#c/?c/$ XX%%
HHNNDH}}}%--!?**TWWd.A.AB77<<5(^tyy-H"66		. 9D ww||s*~/J IIn5%a//#44Q7'3//#33A6"??62D##G-@-@$G-- "@}G LL+.  &  	 '>aKF ((&99   666	 
 " ?13VD((&9s8##%%''..~>> &?sa   $J: K :KKO$,O$5O$!L,,M7MO$MMO$(A3O$#O$c                   V ^8  d   QhRR/# )r7   r:   zdict[int, Any] | Noner'   )r;   s   "r1   r<   r  ;  s     1 1/ 1r0   c                	    R V P                   9  d   V P                  4        R V P                   9  d   RV P                   9  d   R# V P                  4       P                  4       # )rw  zRaw profile type exifN)r   r  getexif_get_merged_dictrq   s   &r1   _getexifPngImageFile._getexif;  sG    "IIK"'>dii'O||~..00r0   c                   V ^8  d   QhRR/# )r7   r:   z
Image.Exifr'   )r;   s   "r1   r<   r  B  s     ! ! !r0   c                	b   < R V P                   9  d   V P                  4        \        SV `  4       # )rw  )r   r  r   r  )r[   r   s   &r1   r  PngImageFile.getexifB  s%    "IIKw  r0   )__frame__idat__prepare_idat__rewind__rewind_idatr  r  r  r  r  r  r  r  r  r  r  r  r  r  rS   r  r   r  r  r  r  r  r   r   )r(   r)   r*   r+   r;   format_descriptionr  propertyr   r   rc   r  re   r  r  r  r  r  r/   r  r  s   @r1   r  r    s`    F4A-F  $+bIH/ (D<(|1! !r0   r  L;1r>  c               (    V ^8  d   QhRRRRRRRR/# r7   rS   rT   rk   r9   rI   r:   rU   r'   )r;   s   "r1   r<   r<   `  s(        u  r0   c                    RP                  V4      pV P                  \        \        V4      4      V,           4       V P                  V4       \	        V\	        V4      4      pV P                  \        V4      4       R# )z'Write a PNG chunk (including CRC field)r0   N)joinwriteo32rF  rN   )rS   rk   rI   	byte_datar   s   &&*  r1   putchunkr  `  sW     IHHSY 3&'HHY
F3K
(CHHSXr0   c                  .    ] tR tRtR R ltR R ltRtR# )_idatik  c               $    V ^8  d   QhRRRRRR/# )r7   rS   rT   chunkCallable[..., None]r:   rU   r'   )r;   s   "r1   r<   _idat.__annotate__n  s"      9 -@ T r0   c                	    Wn         W n        R # rX   )rS   r  )r[   rS   r  s   &&&r1   r\   _idat.__init__n  s    
r0   c                    V ^8  d   QhRRRR/# r7   rI   r9   r:   rU   r'   )r;   s   "r1   r<   r  r  s     + +% +D +r0   c                	@    V P                  V P                  R V4       R# )r  Nr  rS   r[   rI   s   &&r1   r  _idat.writer  s    

477GT*r0   r#  Nr(   r)   r*   r+   r\   r  r/   r'   r0   r1   r  r  k  s    + +r0   r  c                  .    ] tR tRtR R ltR R ltRtR# )_fdativ  c               (    V ^8  d   QhRRRRRRRR/# )	r7   rS   rT   r  r  r   rK   r:   rU   r'   )r;   s   "r1   r<   _fdat.__annotate__y  s*      9 -@ 3 SW r0   c                	*    Wn         W n        W0n        R # rX   )rS   r  r   )r[   rS   r  r   s   &&&&r1   r\   _fdat.__init__y  s    
r0   c                    V ^8  d   QhRRRR/# r!  r'   )r;   s   "r1   r<   r*  ~  s      % D r0   c                	    V P                  V P                  R \        V P                  4      V4       V ;P                  ^,          un        R# )r  N)r  rS   r  r   r$  s   &&r1   r  _fdat.write~  s/    

477GS%6=r0   )r  rS   r   Nr&  r'   r0   r1   r(  r(  v  s    
 r0   r(  c                  6    ] tR tRt$ R]R&   R]R&   R]R&   RtR	# )
_Framei  Image.Imager  z tuple[int, int, int, int] | Noner  zdict[str, Any]encoderinfor'   Nr   r'   r0   r1   r1  r1    s    O
**r0   r1  c               8    V ^8  d   QhRRRRRRRRR	RR
RRRRR/# )r7   r  r2  rS   rT   r  r  r  r   r  r  zImage.Image | Noneappend_imageszlist[Image.Image]r:   r'   )r;   s   "r1   r<   r<     sb     K KKK K 	K
 K &K %K Kr0   c                   V P                   P                  R 4      pV P                   P                  RV P                  P                  R^ 4      4      pV P                   P                  RV P                  P                  R\        P                  4      4      p	V P                   P                  RV P                  P                  R\
        P                  4      4      p
V'       d   \        P                  ! V4      pM\        P                  ! V .V4      p. p^ pV EF<  p\        P                  ! V4       EF  pVP                  V8X  d   VP                  4       pMVP                  V4      pV P                   P                  4       p\        V\        \         34      '       d   W},          VR &   M+Vf(   R VP                  9   d   VP                  R ,          VR &   \        V	\        \         34      '       d   W,          VR&   \        V
\        \         34      '       d   W,          VR&   V^,          pV'       Ed   VR,          pVP                   P                  R4      pVP                   P                  R4      pV\        P"                  8X  d!   \%        V4      ^8  d   \        P&                  pV\        P&                  8X  d   VP(                  P                  4       p\*        P,                  P/                  RV P0                  R4      pVP2                  pV'       d   VP5                  V4      pMRV P0                  ,           pVP7                  VV4       M5V\        P"                  8X  d   VR,          P(                  pMVP(                  p\8        P:                  ! VP                  R4      VP                  R4      4      pVP=                  RR7      pV'       g]   VVP                  R4      8X  dG   VVP                  R4      8X  d1   R V9   d*   VP                   R ;;,          VR ,          ,          uu&   EK  MRpVP?                  \A        VVV4      4       EK   	  EK?  	  \%        V4      ^8X  d   V'       g   V^ ,          P(                  # V! VR\C        \%        V4      4      \C        V4      4       V'       d   V P                  V8w  d   V P                  V4      p \D        PF                  ! V \I        \J        \L        ,          \O        W4      4      \D        PP                  ! R	RV P0                  ,           ^ V4      .4       ^ p\S        V4       EF%  w  ppVP(                  pVP2                  '       g   RVP0                  ,           pMVP2                  pVP5                  V4      pVP0                  pVP                   p\U        \W        VP                  R ^ 4      4      4      pVP                  RV	4      pVP                  RV
4      pV! VR
\C        V4      \C        V^ ,          4      \C        V^,          4      \C        V^ ,          4      \C        V^,          4      \Y        V4      \Y        R4      \[        V4      \[        V4      4       V^,          pV^ 8X  do   V'       gg   \D        PF                  ! V\I        \J        \L        ,          \O        W4      4      \D        PP                  ! R	RVP0                  ,           ^ V4      .4       EK  \]        WV4      p\D        PF                  ! V\I        \J        \L        ,          V4      \D        PP                  ! R	RVP0                  ,           ^ V4      .4       VP^                  pEK(  	  R# )r  r|  r  r  Nr$   F)
alpha_onlys   acTLr   r  r  )r   r   r   r   r   )0r3  r  r   r&   r,   r3   r4   	itertoolschainr   Iteratorr  r   r  r   listrG  r.   rF  r-   r  r   r  r  r  r  cropr  r	   subtract_modulogetbboxr   r1  r  r
   _saver   r   r9   r  r  	enumeraterK   roundo16r   r(  r   ) r  rS   r  r  r  r  r5  r  r|  r  r  r;  	im_framesframe_countim_seqim_framer3  previousprev_disposal
prev_blendbase_imr  r  deltar   r  
frame_datar  frame_durationframe_disposalframe_blendfdat_chunkss    &&&&&&&                         r1   _write_multiple_framesrS    s    ~~!!*-H>>fbggkk&!&<=D~~!!*bggkk*hFVFV.WXHNNwGU__(MNE.m4 IK%..v6H}}$#==?#++D1..--/K(T5M22*2*?J'!jHMM&A*2--
*CJ'(T5M22*2*?J'%$//','9G$1Ky$R= ( 4 4 8 8 D%1155g>
 H$8$88S^a=O$,$:$:M H$:$::&kk..0G#jjoofbgg|LG#==D"),,t"4%/MM'40"h&:&::'m..G&kkG"22$$V,goof.E }}}6%)DD"koog&>>"k1((4J8OO4VHdK@Ae 7 j 9~=| 

C	ND		 77d?D!BEE",-__UFRWW$4aAB	
 G&y1z==HMM)D??D}}T*H}} ,,U;??:q#ABC$X>!oogu5LQLQLQLQLI~{O	
 	1A:mOORYb 01(>7KL  73KOORY,(>7KL
 "))GU 2V r0   c               (    V ^8  d   QhRRRRRRRR/# )	r7   r  r2  rS   rT   filenamer   r:   rU   r'   )r;   s   "r1   r<   r<     s(     + ++ +9 + + +r0   c                "    \        WVR R7       R# )T)save_allN)rA  )r  rS   rU  s   &&&r1   	_save_allrX    s    	"(T*r0   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r7   r  r2  rS   rT   rU  r   r  r  rW  r   r:   rU   r'   )r;   s   "r1   r<   r<     sL     P PPP P 	P
 P 
Pr0   c                  a( V'       Ed>   V P                   P                  R V P                  P                  R 4      4      p\        4       p\        4       o(V P                   P                  R. 4      p\        P
                  ! V .V4       FV  p\        P                  ! V4       F9  p	VP                  V	P                  4       S(P                  V	P                  4       K;  	  KX  	  R4 F  p
W9   g   K   M	  VP                  4       p
\        ;QJ d     . V(3R l\        ^4       4       F  NK  	  5M! V(3R l\        ^4       4       4      pMV P                  pV P                  p
T
pV
R8X  d   RV P                   9   d&   \        ^V P                   R,          ,          R4      pMZV P                  '       dG   \!        \        \#        V P                  P%                  4       ^,          4      ^,          R4      ^4      pMRpV^8:  d#   V^8:  d   ^pMV^8:  d   ^pM^pVRV 2,          pV P                   P                  R	R
4      V P                   P                  RR54      V P                   P                  RR54      V P                   P                  RR4      3V n         \(        V,          w  pppTR8X  d   \/        R^^R7       TP1                  \2        4       T! TR\5        T^ ,          4      \5        T^,          4      TTRRR4	       . R6OpT P                   P                  RT P                  P                  R4      4      pT'       dB   RpTR,           \6        P8                  ! T4      ,           pT! TRT4       TP;                  R4       T P                   P                  R4      pT'       d   . R7OpTP<                   F  pTR,          w  ppTT9   d   TP;                  T4       T! TTT4       K3  TT9   d   T! TTT4       KF  TR,          P?                  4       '       g   Ke  \#        T4      ^8H  ;'       d
    T^,          pT'       d   K  T! TTT4       K  	  T P                  R8X  dM   X^,          pT P@                  PC                  R4      RT p\#        T4      T8  d   TR,          pK  T! TRT4       T P                   P                  R T P                  P                  R R4      4      pT'       g	   T^ 8X  Ed   T P                  R8X  d]   Xp \E        T\F        4      '       d   T! TR!TRT  4       EM5\!        ^ \        ^T4      4      pR"T,          R,           p!T! TR!T!RT  4       EM T P                  R89   d+   \!        ^ \        R#T4      4      pT! TR!\I        T4      4       MT P                  R8X  d;   Tw  p"p#p$T! TR!\I        T"4      \I        T#4      ,           \I        T$4      ,           4       MzR T P                   9   d   R$p\-        T4      hM[T P                  R8X  dK   T P@                  PK                  4       R8X  d,   T P@                  PC                  RR%4      p!Xp T! TR!T!RT  4       T P                   P                  R&4      p%T%'       d[   T! TR'\5        \M        T%^ ,          R(,          R),           4      4      \5        \M        T%^,          R(,          R),           4      4      R*4       T'       dH   R+R,.pTP<                   F3  pTR,          w  ppTT9   g   K  TP;                  T4       T! TTT4       K5  	  T P                   P                  R-4      p&T&'       d\   \E        T&\N        PP                  4      '       d   T&PS                  ^4      p&T&PU                  R.4      '       d
   T&R/,          p&T! TR0T&4       T p'T'       d   \W        YY:TXX4      p'T''       dd   \X        PZ                  ! T'\]        \^        \F        ,          \a        Y4      4      \X        Pb                  ! R1R9T'P                  ,           ^ T4      .4       T'       dr   TP<                   Fa  pTR,          w  ppTR,          P?                  4       '       g   K.  \#        T4      ^8H  ;'       d
    T^,          pT'       g   KW  T! TTT4       Kc  	  T! TR2R4       \e        TR34      '       d   TPg                  4        R# R#   \*         d   pRT
 R2p\-        T4      ThRp?ii ; i):r  r5  r$   r   r   c              3  P   <a"   T F  o\        V3R  lS 4       4      x  K  	  R# 5i)c              3  4   <"   T F  qS,          x  K  	  R # 5irX   r'   )r@  
frame_sizer  s   & r1   rB  "_save.<locals>.<genexpr>.<genexpr>4  s     ?:As   N)max)r@  r  sizess   &@r1   rB  _save.<locals>.<genexpr>4  s     RAS????s   "&bits   ;optimizeFcompress_levelcompress_type
dictionaryr0   zcannot write mode z as PNGNr>  zSaving I mode images as PNG)
stacklevels   IHDRr      sRGBr
  s   ICC Profiler   s   iCCPpnginfo:Nr7   Nr  s   PLTEr/  s   tRNS   i  z%cannot use transparency for this modeArS  s   pHYsrR  g      ?   s   bKGDs   hISTrw  rv  :   NNs   eXIfr   r   flush)r$   r   r   r8  )s   cHRMs   cICPs   gAMAs   sBITrj  s   tIME)s   sPLTr   r   r   )r   r   r>  r   r   )4r3  r  r   setr:  r;  r   r<  r   r  r  rb   rG  r  r  r  r_  rF  getdataencoderconfig	_OUTMODESKeyErrorr   r   r  r  r  r>   r   remover   r  r  
getpaletter   r9   rD  getpalettemoderK   r   Exiftobytesr  rS  r
   rA  r   r   r  r  hasattrrp  ))r  rS   rU  r  rW  r  modesr5  rG  rH  r  r  outmodecolorsrb  r  	bit_depth
color_typer   rF   r   iccnamerI   r   chunks_multiple_allowed
info_chunkrk   r   palette_byte_numberpalette_bytesr/  alpha_bytesalpharedgreenbluerS  rw  	single_imr`  s)   &&&&&                                   @r1   rA  rA    s[    x**RWW[[9
 **?B?oordM:F)226:		(--(		(--( ; ; )D} ) 99;DuRqRuuRqRRwwwwGs{ R^^#bnnV44c:F zzzSRZZ%7%7%9!%<!=!BCH!LR<{14&z!G 	:u-
+R0
?B/
<-	B")27);&J #~/B
 HHV	
DGDG
 DF
..

]BGGKK,F
GC
 g~c 22b'4  	g>>i(D"F++J"2ICf}c"b#t$//b#t$S!!## _1CCjm
!z"c4( & 
ww#~$qj((/0D1DE- #66U"Mb'=)>>%%nbggkk.RV6WXL|q(77c> K,..b'<#=>"1c#|&<=,.6b'5+#67WW//q#e\":;L"gs<01WW+C"gs3x#e*4s4y@A/ >cl"	 0 77c>bee224>EE$$VS1E K"gu\k23
..

U
#C
CFVOc)*+CFVOc)*+	
 7#++J"2ICf}c"b#t$	 & >>f%DdEJJ''<<?D???++8Db'4 $&I*E-
	 EE",-__UFY^^$;QHI	
 ++J"2IC3x!! _1CCjm
:"c4( & 
"gsr7

 _  ""4&0cl!"s   c c;$c66c;c               $    V ^8  d   QhRRRRRR/# )r7   r  r2  paramsr   r:   z list[tuple[bytes, bytes, bytes]]r'   )r;   s   "r1   r<   r<     s"      +  1Q r0   c                r   a ^ RI Hp . oR V3R llpV! 4       p Wn        \        WRV4       V =S#   T =i ; i)z4Return a list of PNG chunks representing this image.)BytesIOc               (    V ^8  d   QhRRRRRRRR/# r  r'   )r;   s   "r1   r<   getchunks.<locals>.__annotate__  s(     - -9 -5 - -4 -r0   c                   < R P                  V4      p\        \        V\        V4      4      4      pSP                  WV34       R# )r0   N)r  r  rN   r   )rS   rk   rI   r  r   r   s   &&*  r1   r   getchunks.<locals>.append  s6    HHTN	&F3K01ss+,r0   r   )ior  r3  rA  )r  r  r  r   rS   r   s   &,   @r1   	getchunksr    sG    F- -
 
Bbb&!NM Ns   2 6z.pngz.apngz	image/png)rf  r   )r   r   )r7   r   )r   r   )r`   r   )r   r   )r  r   )r   r   )   r   )r   r   )r  r7   )r   r   )r  r7   )r   zRGB;16B)rf     )r   r    )r7   r  )r   r!   )r`   r  )r   r"   )r  r  )r   r   )r  r`   )r#   r#   )r  r`   )r$   zLA;16B)r  ro  )r$   r$   )r  ro  )r$   zRGBA;16B)r   )r   rn  r   )r  rn  r   )r      r   )r      r   )r      r   )r#   r  r  )r      r   )r    rn     )r!   r  r  )r"   r  r  )r   r  r  )r   r  r  )r$   r     )O
__future__r   r:  loggingrer   r}  r>   enumr   typingr   r   r   r   r   r	   r
   r   r   _binaryr   r2  r   rf   r   r   rD  r   r  
_deprecater   _utilr   TYPE_CHECKINGcollections.abcr   r   r   r   	getLoggerr(   r   compiler1  rg   r  r  r0  	SAFEBLOCKrA   r   r&   r3   rG   rN   rP   r   r   r   r   r   r  r  rt  r  r  r(  r1  rS  rX  rA  r  register_openr;   register_saveregister_save_allregister_extensionsregister_mimer'   r0   r1   <module>r     s  B #   	     ' ' G G ! !  ! ! !  ($			8	$	L	!	'	' 
 J
L
L
J
N
L
L
L
J
L
!+
2 **01$$
 ~%w *G /[ [|3 6Y3 Y3@: d4 d4V%S!9&& S!v
 	 	$	$	$	 
"	$
'(	$	$	$	 	$
&!	(+ +
 
 Z  K\+ "*Pn2   L''w ?   L'' /   ++Y 7   ,--/@ A   L'' 5r0   