@requires_application()
def test_image():
 size = (100, 50)
 with TestingCanvas(size=size, bgcolor='w') as c:
  image = Image(cmap='grays', clim=[0, 1], parent=c.scene)
  for three_d in (True, False):
   shape = (((size[1] - 10), (size[0] - 10)) + ((3,) if three_d 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 three_d else '_mono')))

@ requires_application ( ) def test_image ( ) : size = ( 100 , 50 ) with TestingCanvas ( size = size , bgcolor = 'w' ) as c : image = Image ( cmap = 'grays' , clim = [ 0 , 1 ] , parent = c . scene ) for three_d in ( True , False ) : shape = ( ( ( size [ 1 ] - 10 ) , ( size [ 0 ] - 10 ) ) + ( ( 3 , ) if three_d 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 three_d else '_mono' ) ) )
ensure that its possible to output images with hug .