Note
Go to the end to download the full example code
Add grayscale image#
Display one grayscale image using the add_image API.
import numpy as np
from skimage import data
import napari
# simulating a grayscale image here for testing contrast limits adjustments
image = data.astronaut().mean(-1) * 100 + 100
image += np.random.rand(*image.shape) * 3000
viewer = napari.view_image(image.astype(np.uint16))
if __name__ == '__main__':
napari.run()