Commit 27cb5e3
committed
Filter images in premultiplied alpha mode.
Test e.g. with
```python
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(figsize=(6, 6))
img = np.zeros((5, 5, 4))
img[..., 1] = 1.
img[..., 3] = np.tril(np.ones((5, 5)))
fig.add_subplot(221).imshow(img, interpolation="bilinear")
fig.add_subplot(222).imshow((img * 0xff).astype("u1"), interpolation="bilinear")
fig.add_subplot(212).imshow(
np.where(
np.mgrid[:100, :200][0] > np.random.randint(100, size=200),
np.arange(100)[:, None], np.nan),
cmap="Greens", interpolation="antialiased", interpolation_stage="rgba")
plt.show()
```1 parent 9f7b3dd commit 27cb5e3
File tree
5 files changed
+27
-24
lines changed- lib/matplotlib
- tests
- baseline_images/test_image
5 files changed
+27
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
| 499 | + | |
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
504 | 507 | | |
| 508 | + | |
505 | 509 | | |
506 | 510 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 511 | + | |
513 | 512 | | |
514 | 513 | | |
515 | | - | |
516 | | - | |
517 | | - | |
| 514 | + | |
518 | 515 | | |
519 | 516 | | |
520 | | - | |
| 517 | + | |
521 | 518 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
528 | 531 | | |
529 | | - | |
| 532 | + | |
530 | 533 | | |
531 | 534 | | |
532 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
| 268 | + | |
| 269 | + | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments