Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d127c4

Browse files
committed
Discard the transparency layer (if any) only if the image is completely opaque.
1 parentbb2d5f2 commit5d127c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎lib/matplotlib/testing/compare.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ def calculate_rms(expected_image, actual_image):
373373

374374
def_load_image(path):
375375
img=Image.open(path)
376-
returnnp.asarray(imgifimg.mode=="RGBA"elseimg.convert("RGB"))
376+
ifimg.mode=="RGBA"andimg.getextrema()[3][0]<255:
377+
returnnp.asarray(img)
378+
returnnp.asarray(img.convert("RGB"))
377379

378380

379381
defcompare_images(expected,actual,tol,in_decorator=False):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp