Skip to content

Commit 9bb5365

Browse files
committed
rel 2024 update dependencies
1 parent 8e76760 commit 9bb5365

File tree

6 files changed

+49
-80
lines changed

6 files changed

+49
-80
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All major and minor version changes will be documented in this file. Details of
44
patch-level version changes can be found in [commit messages](../../commits/master).
55

6+
## 2024 - 2024/01/07
7+
8+
- update dependencies
9+
610
## 2023 - 2023/08/31
711

812
- Update deps

blendmodes/blend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ def imageFloatToInt(image: np.ndarray) -> np.ndarray:
378378
Returns:
379379
np.ndarray: numpy array of ints
380380
"""
381-
return (image * 255).astype(np.uint8)
381+
clippedIm = np.clip((image * 255).round(), 0, 255)
382+
with warnings.catch_warnings():
383+
warnings.filterwarnings("ignore", category=RuntimeWarning)
384+
return clippedIm.astype(np.uint8)
382385

383386

384387
def blend(background: np.ndarray, foreground: np.ndarray, blendType: BlendType) -> np.ndarray:

documentation/reference/blendmodes/blend.md

Lines changed: 36 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ BlendType.ADDITIVE.
5151
#### Signature
5252

5353
```python
54-
def additive(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
55-
...
54+
def additive(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
5655
```
5756

5857

5958

6059
## blend
6160

62-
[Show source in blend.py:384](../../../blendmodes/blend.py#L384)
61+
[Show source in blend.py:387](../../../blendmodes/blend.py#L387)
6362

6463
Blend pixels.
6564

@@ -99,15 +98,14 @@ Blend pixels.
9998
```python
10099
def blend(
101100
background: np.ndarray, foreground: np.ndarray, blendType: BlendType
102-
) -> np.ndarray:
103-
...
101+
) -> np.ndarray: ...
104102
```
105103

106104

107105

108106
## blendLayers
109107

110-
[Show source in blend.py:448](../../../blendmodes/blend.py#L448)
108+
[Show source in blend.py:451](../../../blendmodes/blend.py#L451)
111109

112110
Blend layers using numpy array.
113111

@@ -130,8 +128,7 @@ def blendLayers(
130128
foreground: Image.Image,
131129
blendType: BlendType | tuple[str, ...],
132130
opacity: float = 1.0,
133-
) -> Image.Image:
134-
...
131+
) -> Image.Image: ...
135132
```
136133

137134

@@ -145,8 +142,7 @@ BlendType.COLOUR.
145142
#### Signature
146143

147144
```python
148-
def colour(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
149-
...
145+
def colour(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
150146
```
151147

152148

@@ -160,8 +156,7 @@ BlendType.COLOURBURN.
160156
#### Signature
161157

162158
```python
163-
def colourburn(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
164-
...
159+
def colourburn(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
165160
```
166161

167162

@@ -175,8 +170,7 @@ BlendType.COLOURDODGE.
175170
#### Signature
176171

177172
```python
178-
def colourdodge(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
179-
...
173+
def colourdodge(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
180174
```
181175

182176

@@ -190,8 +184,7 @@ BlendType.DARKEN.
190184
#### Signature
191185

192186
```python
193-
def darken(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
194-
...
187+
def darken(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
195188
```
196189

197190

@@ -212,8 +205,7 @@ def destatop(
212205
foregroundAlpha: np.ndarray,
213206
backgroundColour: np.ndarray,
214207
foregroundColour: np.ndarray,
215-
):
216-
...
208+
): ...
217209
```
218210

219211

@@ -242,8 +234,7 @@ def destin(
242234
foregroundAlpha: np.ndarray,
243235
backgroundColour: np.ndarray,
244236
foregroundColour: np.ndarray,
245-
):
246-
...
237+
): ...
247238
```
248239

249240

@@ -266,8 +257,7 @@ def destout(
266257
foregroundAlpha: np.ndarray,
267258
backgroundColour: np.ndarray,
268259
foregroundColour: np.ndarray,
269-
):
270-
...
260+
): ...
271261
```
272262

273263

@@ -281,8 +271,7 @@ BlendType.DIFFERENCE.
281271
#### Signature
282272

283273
```python
284-
def difference(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
285-
...
274+
def difference(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
286275
```
287276

288277

@@ -296,8 +285,7 @@ BlendType.DIVIDE.
296285
#### Signature
297286

298287
```python
299-
def divide(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
300-
...
288+
def divide(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
301289
```
302290

303291

@@ -311,8 +299,7 @@ BlendType.EXCLUSION.
311299
#### Signature
312300

313301
```python
314-
def exclusion(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
315-
...
302+
def exclusion(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
316303
```
317304

318305

@@ -326,8 +313,7 @@ BlendType.GLOW.
326313
#### Signature
327314

328315
```python
329-
def glow(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
330-
...
316+
def glow(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
331317
```
332318

333319

@@ -341,8 +327,7 @@ BlendType.GRAINEXTRACT.
341327
#### Signature
342328

343329
```python
344-
def grainextract(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
345-
...
330+
def grainextract(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
346331
```
347332

348333

@@ -356,8 +341,7 @@ BlendType.GRAINMERGE.
356341
#### Signature
357342

358343
```python
359-
def grainmerge(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
360-
...
344+
def grainmerge(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
361345
```
362346

363347

@@ -371,8 +355,7 @@ BlendType.HARDLIGHT.
371355
#### Signature
372356

373357
```python
374-
def hardlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
375-
...
358+
def hardlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
376359
```
377360

378361

@@ -386,8 +369,7 @@ BlendType.HUE.
386369
#### Signature
387370

388371
```python
389-
def hue(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
390-
...
372+
def hue(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
391373
```
392374

393375

@@ -409,8 +391,7 @@ Convert a numpy array representing an image to an array of ints.
409391
#### Signature
410392

411393
```python
412-
def imageFloatToInt(image: np.ndarray) -> np.ndarray:
413-
...
394+
def imageFloatToInt(image: np.ndarray) -> np.ndarray: ...
414395
```
415396

416397

@@ -432,8 +413,7 @@ Convert a numpy array representing an image to an array of floats.
432413
#### Signature
433414

434415
```python
435-
def imageIntToFloat(image: np.ndarray) -> np.ndarray:
436-
...
416+
def imageIntToFloat(image: np.ndarray) -> np.ndarray: ...
437417
```
438418

439419

@@ -447,8 +427,7 @@ BlendType.LIGHTEN.
447427
#### Signature
448428

449429
```python
450-
def lighten(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
451-
...
430+
def lighten(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
452431
```
453432

454433

@@ -462,8 +441,7 @@ BlendType.LUMINOSITY.
462441
#### Signature
463442

464443
```python
465-
def luminosity(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
466-
...
444+
def luminosity(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
467445
```
468446

469447

@@ -477,8 +455,7 @@ BlendType.MULTIPLY.
477455
#### Signature
478456

479457
```python
480-
def multiply(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
481-
...
458+
def multiply(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
482459
```
483460

484461

@@ -492,8 +469,7 @@ BlendType.NEGATION.
492469
#### Signature
493470

494471
```python
495-
def negation(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
496-
...
472+
def negation(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
497473
```
498474

499475

@@ -507,8 +483,7 @@ BlendType.NORMAL.
507483
#### Signature
508484

509485
```python
510-
def normal(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
511-
...
486+
def normal(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
512487
```
513488

514489

@@ -522,8 +497,7 @@ BlendType.OVERLAY.
522497
#### Signature
523498

524499
```python
525-
def overlay(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
526-
...
500+
def overlay(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
527501
```
528502

529503

@@ -537,8 +511,7 @@ BlendType.PINLIGHT.
537511
#### Signature
538512

539513
```python
540-
def pinlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
541-
...
514+
def pinlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
542515
```
543516

544517

@@ -552,8 +525,7 @@ BlendType.REFLECT.
552525
#### Signature
553526

554527
```python
555-
def reflect(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
556-
...
528+
def reflect(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
557529
```
558530

559531

@@ -567,8 +539,7 @@ BlendType.SATURATION.
567539
#### Signature
568540

569541
```python
570-
def saturation(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
571-
...
542+
def saturation(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
572543
```
573544

574545

@@ -582,8 +553,7 @@ BlendType.SCREEN.
582553
#### Signature
583554

584555
```python
585-
def screen(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
586-
...
556+
def screen(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
587557
```
588558

589559

@@ -597,8 +567,7 @@ BlendType.SOFTLIGHT.
597567
#### Signature
598568

599569
```python
600-
def softlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
601-
...
570+
def softlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
602571
```
603572

604573

@@ -617,8 +586,7 @@ def srcatop(
617586
foregroundAlpha: np.ndarray,
618587
backgroundColour: np.ndarray,
619588
foregroundColour: np.ndarray,
620-
):
621-
...
589+
): ...
622590
```
623591

624592

@@ -632,8 +600,7 @@ BlendType.VIVIDLIGHT.
632600
#### Signature
633601

634602
```python
635-
def vividlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
636-
...
603+
def vividlight(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
637604
```
638605

639606

@@ -647,6 +614,5 @@ BlendType.XOR.
647614
#### Signature
648615

649616
```python
650-
def xor(background: np.ndarray, foreground: np.ndarray) -> np.ndarray:
651-
...
617+
def xor(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
652618
```

documentation/reference/blendmodes/blendtype.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,5 @@ DESTATOP = "bm:destatop", "destatop"
4949
#### Signature
5050

5151
```python
52-
class BlendType(str, MultiValueEnum):
53-
...
52+
class BlendType(str, MultiValueEnum): ...
5453
```

0 commit comments

Comments
 (0)