Commit 9f0e454
committed
ANI: Reduce Pillow frames to RGB when opaque
In some cases, such as GIF output, Pillow must convert to P (palette)
mode. Unfortunately, when done on RGBA images, this can lose some colour
information (cf, python-pillow/Pillow#6832)
But when the image starts in RGB mode, the conversion to P mode works
better, so convert frames to RGB when they don't have any transparent
pixels.
Fixes matplotlib#291901 parent 84fbae8 commit 9f0e454
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
496 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
497 | 504 | | |
498 | 505 | | |
499 | 506 | | |
| |||
0 commit comments