a :jg+ã@srddlmZddlmZmZmZGdd„dƒZGdd„deƒZGdd „d eƒZGd d „d eƒZ Gd d „d eƒZ dS)é)Ú annotationsé)ÚImageÚ ImageFilterÚ ImageStatc@s.eZdZUded<ded<dddœdd„ZdS) Ú_Enhanceú Image.ImageÚimageÚ degenerateÚfloat)ÚfactorÚreturncCst |j|j|¡S)aµ Returns an enhanced image. :param factor: A floating point value controlling the enhancement. Factor 1.0 always returns a copy of the original image, lower factors mean less color (brightness, contrast, etc), and higher values more. There are no restrictions on this value. :rtype: :py:class:`~PIL.Image.Image` )rÚblendr r )Úselfr ©rú:/usr/local/lib/python3.9/site-packages/PIL/ImageEnhance.pyÚenhances z_Enhance.enhanceN)Ú__name__Ú __module__Ú __qualname__Ú__annotations__rrrrrrs rc@s eZdZdZdddœdd„ZdS)ÚColoraAdjust image color balance. This class can be used to adjust the colour balance of an image, in a manner similar to the controls on a colour TV set. An enhancement factor of 0.0 gives a black and white image. A factor of 1.0 gives the original image. rÚNone©r r cCsH||_d|_d| ¡vrd|_|j|jkr>| |j¡ |j¡}||_dS)NÚLÚAZLA)r Zintermediate_modeÚgetbandsÚmodeÚconvertr ©rr rrrÚ__init__4s  zColor.__init__N©rrrÚ__doc__r rrrrr+src@s eZdZdZdddœdd„ZdS)ÚContrastzòAdjust image contrast. This class can be used to control the contrast of an image, similar to the contrast control on a TV set. An enhancement factor of 0.0 gives a solid gray image. A factor of 1.0 gives the original image. rrrcCsŒ||_|jdkr| d¡}tt |¡jddƒ}t d|j |¡|_ |j j|jjkrf|j  |jj¡|_ d|j  ¡vrˆ|j   |j  d¡¡dS)Nrrgà?r)r rrÚintrZStatÚmeanrÚnewÚsizer rÚputalphaÚ getchannel)rr r%rrrr Gs  zContrast.__init__Nr!rrrrr#?sr#c@s eZdZdZdddœdd„ZdS)Ú BrightnesszÅAdjust image brightness. This class can be used to control the brightness of an image. An enhancement factor of 0.0 gives a black image. A factor of 1.0 gives the original image. rrrcCs<||_t |j|jd¡|_d| ¡vr8|j | d¡¡dS)Nrr) r rr&rr'r rr(r)rrrrr \s zBrightness.__init__Nr!rrrrr*Tsr*c@s eZdZdZdddœdd„ZdS)Ú SharpnesszðAdjust image sharpness. This class can be used to adjust the sharpness of an image. An enhancement factor of 0.0 gives a blurred image, a factor of 1.0 gives the original image, and a factor of 2.0 gives a sharpened image. rrrcCs6||_| tj¡|_d| ¡vr2|j | d¡¡dS)Nr)r ÚfilterrZSMOOTHr rr(r)rrrrr ls zSharpness.__init__Nr!rrrrr+dsr+N) Ú __future__rÚrrrrrr#r*r+rrrrÚs