code: def expand_image(image, shape):
      
      if (shape[0] % image.shape[0]) or (shape[1] % image.shape[1]):
          raise ValueError("Output shape must be an integer multiple of input "
                           "image shape.")
      sx = shape[1] // image.shape[1]
      sy = shape[0] // image.shape[0]
  
      ox = (sx - 1.0) / (2.0 * sx)
      oy = (sy - 1.0) / (2.0 * sy)
  
      # generate output coordinates:
      y, x = np.indices(shape, dtype=np.float)
      x = x / sx - ox
      y = y / sy - oy
  
      # interpolate:
      return bilinear_interp(image, x, y)
docs: Expand image from original shape to requested shape. Output shape
      must be an integer multiple of input image shape for each axis.