Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace two manual screenshots of the viewer (launch_cli_empty and launch_cli_image) with nbscreenshots #606

Merged
merged 6 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/_static/images/launch_cli_empty.png
Binary file not shown.
Binary file removed docs/_static/images/launch_cli_image.png
Binary file not shown.
40 changes: 38 additions & 2 deletions docs/tutorials/fundamentals/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
---
jupytext:
formats: ipynb,md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.5
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

(launch)=
# How to launch napari

Expand Down Expand Up @@ -31,7 +45,16 @@ napari

This command will launch an empty viewer:

![image: an empty napari viewer](../../_static/images/launch_cli_empty.png)
```{code-cell} ipython3
:tags: [remove-input]
import napari
from napari.utils import nbscreenshot


viewer = napari.Viewer()

nbscreenshot(viewer, alt_text="Screenshot of an empty napari viewer, right after launching.")
```

Once you have the viewer open you can add images through the `File -> Open` dropdown menu
or by dragging and dropping images directly on the viewer. We currently only support files that can be read with [`skimage.io.imread`](https://scikit-image.org/docs/dev/api/skimage.io.html#skimage.io.imread),
Expand All @@ -45,7 +68,20 @@ napari my_image.png

If the image is `RGB` or `RGBA` use the `-r` or `--rgb` flag.

![image: napari viewer displaying an image layer](../../_static/images/launch_cli_image.png)
Here's an example of a viewer with an RGB image, the `astronaut` sample image.

```{code-cell} ipython3
:tags: [remove-input]
import napari
from napari.utils import nbscreenshot
from skimage.data import astronaut


viewer = napari.Viewer()
viewer.add_image(astronaut())

nbscreenshot(viewer, alt_text="Screenshot of an napari viewer showing the scikit-image sample image `astronaut`, which is an RGB image of the astronaut Eileen Collins.")
```

Launching `napari` directly from the command line is the simplest and fastest way to open the viewer,
but it doesn't allow you to preprocess your images before opening them.
Expand Down
34 changes: 21 additions & 13 deletions docs/tutorials/fundamentals/installation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.13.0
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
jupytext:
formats: ipynb,md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.5
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

(napari-installation)=
Expand Down Expand Up @@ -153,7 +152,16 @@ napari

An empty napari viewer should appear as follows:

![macOS desktop with a napari viewer window without any image opened in the foreground, and a terminal in the background with the appropriate conda environment activated (if applicable) and the command to open napari entered.](../../_static/images/launch_cli_empty.png)
```{code-cell} ipython3
:tags: [remove-input]
import napari
from napari.utils import nbscreenshot


viewer = napari.Viewer()

nbscreenshot(viewer, alt_text="Screenshot of an empty napari viewer, right after launching.")
```

````{note}
On some platforms, particularly macOS and Windows, there may be a ~30 second
Expand Down