Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f139f2

Browse files
committed
Remove the alpha channel from the expected and actual images.
(This regressed when the PIL code was migrated to numpy.)
1 parent 3dcc2cb commit 2f139f2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/testing/compare.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ def compare_images( expected, actual, tol, in_decorator=False ):
316316
# open the image files and remove the alpha channel (if it exists)
317317
expectedImage = _png.read_png_int( expected )
318318
actualImage = _png.read_png_int( actual )
319+
expectedImage = expectedImage[:,:,:3]
320+
actualImage = actualImage[:,:,:3]
319321

320322
actualImage, expectedImage = crop_to_same(actual, actualImage, expected, expectedImage)
321323

0 commit comments

Comments
 (0)