CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
ImageEnhance.cpython-310.pyc60 linesDownload Raw Back to __pycache__
1o

2��Yi��@srddlmZddlmZmZmZGdd�d�ZGdd�de�ZGdd	�d	e�ZGd3d�de�Z	Gdd
�d
e�Z4dS)�)�annotations�)�Image�ImageFilter�	ImageStatc@s(eZdZUded<ded<d5dd�Zd	S)�_Enhance�Image.Image�image�6degenerate�factor�float�returncCst�|j|j|�S)a�7        Returns an enhanced image.8 9        :param factor: A floating point value controlling the enhancement.10                       Factor 1.0 always returns a copy of the original image,11                       lower factors mean less color (brightness, contrast,12                       etc), and higher values more. There are no restrictions13                       on this value.14        :rtype: :py:class:`~PIL.Image.Image`15        )r�blendr16r	)�selfr�r�zE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/ImageEnhance.py�enhancesz_Enhance.enhanceN)rrr
r)�__name__�17__module__�__qualname__�__annotations__rrrrrrs18rc@�eZdZdZd	dd�ZdS)19�ColoraAdjust image color balance.20 21    This class can be used to adjust the colour balance of an image, in22    a manner similar to the controls on a colour TV set. An enhancement23    factor of 0.0 gives a black and white image. A factor of 1.0 gives24    the original image.25    r	rr
�NonecCsH||_d|_d|��vrd|_|j|jkr|�|j��|j�}||_dS)N�L�AZLA)r	Zintermediate_mode�getbands�mode�convertr26�rr	rrr�__init__4s27zColor.__init__N�r	rr
r�rrr�__doc__r rrrrr+src@r)28�Contrastz�Adjust image contrast.29 30    This class can be used to control the contrast of an image, similar31    to the contrast control on a TV set. An enhancement factor of 0.032    gives a solid gray image. A factor of 1.0 gives the original image.33    r	rr
rcCs�||_|jdkr
|�d�}tt�|�jdd�}t�d|j	|�|_34|j35j|jjkr3|j36�|jj�|_37d|j��vrF|j38�|j�
d��dSdS)Nrrg�?r)r	rr�intrZStat�meanr�new�sizer39r�putalpha�40getchannel)rr	r&rrrr Gs4142�zContrast.__init__Nr!r"rrrrr$?�r$c@r)4344Brightnessz�Adjust image brightness.45 46    This class can be used to control the brightness of an image.  An47    enhancement factor of 0.0 gives a black image. A factor of 1.0 gives the48    original image.49    r	rr
rcCs@||_t�|j|jd�|_d|��vr|j�|�d��dSdS)Nrr)	r	rr'rr(r50rr)r*rrrrr \s51�zBrightness.__init__Nr!r"rrrrr,Tr+r,c@r)52�	Sharpnessz�Adjust image sharpness.53 54    This class can be used to adjust the sharpness of an image. An55    enhancement factor of 0.0 gives a blurred image, a factor of 1.0 gives the56    original image, and a factor of 2.0 gives a sharpened image.57    r	rr
rcCs:||_|�tj�|_d|��vr|j�|�d��dSdS)Nr)r	�filterrZSMOOTHr58rr)r*rrrrr ls59�zSharpness.__init__Nr!r"rrrrr-dr+r-N)�60__future__r�rrrrrr$r,r-rrrr�<module>s