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

Skip to content

Commit 91c969a

Browse files
committed
test_compare_images: Replace cosine_peak-nn test images with new baseline images
derived from basn3p02 in pngsuite tests. These are much smaller images than the cosine tests.
1 parent 80f89a1 commit 91c969a

11 files changed

+15
-15
lines changed
Binary file not shown.

lib/matplotlib/tests/test_compare_images.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ def test_image_compare_basic():
3838
"""Test comparison of an image and the same image with minor differences."""
3939
# This expects the images to compare equal under normal tolerance, and have
4040
# a small RMS.
41-
im1 = 'cosine_peak-nn-img.png'
42-
im2 = 'cosine_peak-nn-img-minorchange.png'
41+
im1 = 'basn3p02.png'
42+
im2 = 'basn3p02-minorchange.png'
4343
image_comparison_expect_rms(im1, im2, tol=10, expect_rms=None)
4444

4545
# Now test with no tolerance.
46-
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=2.99949)
46+
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=6.50646)
4747

4848
def test_image_compare_1px_offset():
4949
"""Test comparison with an image that is shifted by 1px in the X axis."""
50-
im1 = 'cosine_peak-nn-img.png'
51-
im2 = 'cosine_peak-nn-img-1px-offset.png'
52-
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=22.04263)
50+
im1 = 'basn3p02.png'
51+
im2 = 'basn3p02-1px-offset.png'
52+
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=90.15611)
5353

54-
def test_image_compare_title_1px_offset():
55-
"""Test comparison with an image with the title shifted by 1px in the X
56-
axis."""
57-
im1 = 'cosine_peak-nn-img.png'
58-
im2 = 'cosine_peak-nn-img-title-1px-offset.png'
59-
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=13.77513)
54+
def test_image_compare_half_1px_offset():
55+
"""Test comparison with an image with half the pixels shifted by 1px in the
56+
X axis."""
57+
im1 = 'basn3p02.png'
58+
im2 = 'basn3p02-half-1px-offset.png'
59+
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=63.75)
6060

6161
def test_image_compare_scrambled():
6262
"""Test comparison of an image and the same image scrambled."""
@@ -66,11 +66,11 @@ def test_image_compare_scrambled():
6666
# colour component of each pixel randomly placed somewhere in the image. It
6767
# contains exactly the same number of pixels of each colour value of R, G
6868
# and B, but in a totally different position.
69-
im1 = 'cosine_peak-nn-img.png'
70-
im2 = 'cosine_peak-nn-img-scrambled.png'
69+
im1 = 'basn3p02.png'
70+
im2 = 'basn3p02-scrambled.png'
7171
# Test with no tolerance to make sure that we pick up even a very small RMS
7272
# error.
73-
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=153.19994)
73+
image_comparison_expect_rms(im1, im2, tol=0, expect_rms=172.63582)
7474

7575
def test_image_compare_shade_difference():
7676
"""Test comparison of an image and a slightly brighter image."""

0 commit comments

Comments
 (0)