zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
U
T±dŠã@s¾ddlmZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Zdd„Zdd„Z    dd„Z
dd„Z dd„Z d/dd„Z d0dd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd1d-d.„Zd,S)2é)ÚImagecCst d|j|¡S)zVFill a channel with a given grey level.
 
    :rtype: :py:class:`~PIL.Image.Image`
    ÚL)rÚnewÚsize)ÚimageÚvalue©rúEd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/ImageChops.pyÚconstantsr
cCs| ¡S)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.
 
    :rtype: :py:class:`~PIL.Image.Image`
    )Úcopy©rrrr    Ú    duplicatesr cCs| ¡| |j ¡¡S)zl
    Invert an image (channel). ::
 
        out = MAX - image
 
    :rtype: :py:class:`~PIL.Image.Image`
    )ÚloadÚ_newÚimZ chop_invertr rrr    Úinvert's    rcCs$| ¡| ¡| |j |j¡¡S)z½
    Compares the two images, pixel by pixel, and returns a new image containing
    the lighter values. ::
 
        out = max(image1, image2)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_lighter©Úimage1Úimage2rrr    Úlighter4s
rcCs$| ¡| ¡| |j |j¡¡S)z¼
    Compares the two images, pixel by pixel, and returns a new image containing
    the darker values. ::
 
        out = min(image1, image2)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_darkerrrrr    ÚdarkerCs
rcCs$| ¡| ¡| |j |j¡¡S)z²
    Returns the absolute value of the pixel-by-pixel difference between the two
    images. ::
 
        out = abs(image1 - image2)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_differencerrrr    Ú
differenceRs
rcCs$| ¡| ¡| |j |j¡¡S)a
    Superimposes two images on top of each other.
 
    If you multiply an image with a solid black image, the result is black. If
    you multiply with a solid white image, the image is unaffected. ::
 
        out = image1 * image2 / MAX
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_multiplyrrrr    Úmultiplyas rcCs$| ¡| ¡| |j |j¡¡S)zª
    Superimposes two inverted images on top of each other. ::
 
        out = MAX - ((MAX - image1) * (MAX - image2) / MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_screenrrrr    Úscreenrs    rcCs$| ¡| ¡| |j |j¡¡S)z
    Superimposes two images on top of each other using the Soft Light algorithm
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_soft_lightrrrr    Ú
soft_light€srcCs$| ¡| ¡| |j |j¡¡S)z
    Superimposes two images on top of each other using the Hard Light algorithm
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_hard_lightrrrr    Ú
hard_lightŒsrcCs$| ¡| ¡| |j |j¡¡S)z|
    Superimposes two images on top of each other using the Overlay algorithm
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_overlayrrrr    Úoverlay˜srçð?écCs(| ¡| ¡| |j |j||¡¡S)zé
    Adds two images, dividing the result by scale and adding the
    offset. If omitted, scale defaults to 1.0, and offset to 0.0. ::
 
        out = ((image1 + image2) / scale + offset)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_add©rrZscaleÚoffsetrrr    Úadd¤s
r!cCs(| ¡| ¡| |j |j||¡¡S)zî
    Subtracts two images, dividing the result by scale and adding the offset.
    If omitted, scale defaults to 1.0, and offset to 0.0. ::
 
        out = ((image1 - image2) / scale + offset)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZ chop_subtractrrrr    Úsubtract³s
r"cCs$| ¡| ¡| |j |j¡¡S)z‡Add two images, without clipping the result. ::
 
        out = ((image1 + image2) % MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_add_modulorrrr    Ú
add_moduloÂsr#cCs$| ¡| ¡| |j |j¡¡S)zŒSubtract two images, without clipping the result. ::
 
        out = ((image1 - image2) % MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_subtract_modulorrrr    Úsubtract_moduloÏsr$cCs$| ¡| ¡| |j |j¡¡S)ajLogical AND between two images.
 
    Both of the images must have mode "1". If you would like to perform a
    logical AND on an image with a mode other than "1", try
    :py:meth:`~PIL.ImageChops.multiply` instead, using a black-and-white mask
    as the second image. ::
 
        out = ((image1 and image2) % MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_andrrrr    Ú logical_andÜs r%cCs$| ¡| ¡| |j |j¡¡S)z¦Logical OR between two images.
 
    Both of the images must have mode "1". ::
 
        out = ((image1 or image2) % MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_orrrrr    Ú
logical_orîs
r&cCs$| ¡| ¡| |j |j¡¡S)z³Logical XOR between two images.
 
    Both of the images must have mode "1". ::
 
        out = ((bool(image1) != bool(image2)) % MAX)
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rrrZchop_xorrrrr    Ú logical_xorýs
r'cCst |||¡S)z‰Blend images using constant transparency weight. Alias for
    :py:func:`PIL.Image.blend`.
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rÚblend)rrÚalpharrr    r( sr(cCst |||¡S)z†Create composite using transparency mask. Alias for
    :py:func:`PIL.Image.composite`.
 
    :rtype: :py:class:`~PIL.Image.Image`
    )rÚ    composite)rrÚmaskrrr    r*sr*NcCs(|dkr |}| ¡| |j ||¡¡S)aReturns a copy of the image where data has been offset by the given
    distances. Data wraps around the edges. If ``yoffset`` is omitted, it
    is assumed to be equal to ``xoffset``.
 
    :param image: Input image.
    :param xoffset: The horizontal distance.
    :param yoffset: The vertical distance.  If omitted, both
        distances are set to the same value.
    :rtype: :py:class:`~PIL.Image.Image`
    N)rrrr )rZxoffsetZyoffsetrrr    r  s r )rr)rr)N)Úrr
r rrrrrrrrrr!r"r#r$r%r&r'r(r*r rrrr    Ú<module>s*