@requires_application()
@pytest.mark.parametrize('is_3d', [True, False])
def test_image(is_3d):
    'Test image visual'
    size = (100, 50)
    with TestingCanvas(size=size, bgcolor='w') as c:
        image = Image(cmap='grays', clim=[0, 1], parent=c.scene)
        shape = (((size[1] - 10), (size[0] - 10)) + ((3,) if is_3d else ()))
        np.random.seed(379823)
        data = np.random.rand(*shape)
        image.set_data(data)
        assert_image_approved(c.render(), ('visuals/image%s.png' % ('_rgb' if is_3d else '_mono')))
Test image visual
@requires_application()
@pytest.mark.parametrize('is_3d', [True, False])
def test_image(is_3d):
    
    size = (100, 50)
    with TestingCanvas(size=size, bgcolor='w') as c:
        image = Image(cmap='grays', clim=[0, 1], parent=c.scene)
        shape = (((size[1] - 10), (size[0] - 10)) + ((3,) if is_3d else ()))
        np.random.seed(379823)
        data = np.random.rand(*shape)
        image.set_data(data)
        assert_image_approved(c.render(), ('visuals/image%s.png' % ('_rgb' if is_3d else '_mono')))