selection
The selected area of the document or layer.
Selection
Bases: Photoshop
The selected area of the document.
Source code in photoshop/api/_selection.py
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
clear()
Clears the selection and does not copy it to the clipboard.
Source code in photoshop/api/_selection.py
58 59 60 |
|
contract(contract_by)
Contracts the selection.
Source code in photoshop/api/_selection.py
62 63 64 |
|
copy()
Copies the selection to the clipboard.
Source code in photoshop/api/_selection.py
66 67 68 |
|
cut()
Cuts the current selection to the clipboard.
Source code in photoshop/api/_selection.py
70 71 72 |
|
deselect()
Deselects the current selection.
Source code in photoshop/api/_selection.py
77 78 79 |
|
expand(by)
Expands the selection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
by | int | The amount to expand the selection. | required |
Source code in photoshop/api/_selection.py
81 82 83 84 85 86 87 88 |
|
feather(by)
Feathers the edges of the selection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
by | int | The amount to feather the edge. | required |
Source code in photoshop/api/_selection.py
90 91 92 93 94 95 96 97 |
|
fill(fill_type, mode=None, opacity=None, preserve_transparency=None)
Fills the selection.
Source code in photoshop/api/_selection.py
99 100 101 102 103 104 105 106 107 |
|
grow(tolerance, anti_alias)
Grows the selection to include all adjacent pixels falling within
The specified tolerance range.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tolerance | int | The tolerance range. Range: 0 to 255. | required |
anti_alias | bool | If true, anti-aliasing is used. | required |
Source code in photoshop/api/_selection.py
109 110 111 112 113 114 115 116 117 118 119 120 |
|
invert()
Inverts the selection.
Source code in photoshop/api/_selection.py
122 123 124 |
|
load(from_channel, combination, inverting)
Loads the selection from the specified channel.
Source code in photoshop/api/_selection.py
126 127 128 |
|
makeWorkPath(tolerance)
Makes this selection item the workpath for this document.
Source code in photoshop/api/_selection.py
130 131 132 |
|
resize(horizontal, vertical, anchor)
Resizes the selected area to the specified dimensions and anchor position.
Source code in photoshop/api/_selection.py
134 135 136 137 |
|
resizeBoundary(horizontal, vertical, anchor)
Scales the boundary of the selection.
Source code in photoshop/api/_selection.py
139 140 141 |
|
rotate(angle, anchor)
Rotates the object.
Source code in photoshop/api/_selection.py
143 144 145 |
|
rotateBoundary(angle, anchor)
Rotates the boundary of the selection.
Source code in photoshop/api/_selection.py
147 148 149 |
|
selectBorder(width)
Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width | int | The width of the border selection. | required |
Source code in photoshop/api/_selection.py
166 167 168 169 170 171 172 173 174 |
|
smooth(radius)
Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).
Source code in photoshop/api/_selection.py
179 180 181 182 |
|
store(into, combination=SelectionType.ReplaceSelection)
Saves the selection as a channel.
Source code in photoshop/api/_selection.py
184 185 186 |
|
stroke(strokeColor, width, location, mode, opacity, preserveTransparency)
Strokes the selection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
strokeColor | SolidColor | The color to stroke the selection with. | required |
width | int | The stroke width. | required |
location | int | The stroke location. | required |
mode | int | The color blend mode. | required |
opacity | int | The opacity of the stroke color as a percentage. Range: 1 to 100. | required |
preserveTransparency | bool | If true, preserves transparency. | required |
Source code in photoshop/api/_selection.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
translate(deltaX, deltaY)
Moves the object relative to its current position.
Source code in photoshop/api/_selection.py
188 189 190 |
|
translateBoundary(deltaX, deltaY)
Moves the boundary of selection relative to its current position.
Source code in photoshop/api/_selection.py
192 193 194 |
|
Created: 2024-11-17