Repository: napari/napari

Issue:
[main, macOS 14?] Making new Labels layer using viewer button is broken
### 🐛 Bug Report

`main` d507dd64ed6d96e984fa7fa57f2f232be388b5f7 
I made a fresh env and installed `.[dev]`

 In a fresh viewer, clicking the new Labels button results in a traceback:
`ValueError: Cannot build a texture for dtype raw_dtype=dtype('float64') and view_dtype=dtype('float64')`
Full traceback:
<details>

```
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File ~/dev/napari/napari/components/viewer_model.py:441, in ViewerModel._new_labels(self=Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoo...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}))
    436 shape = [
    437     np.round(s / sc).astype('int') + 1
    438     for s, sc in zip(scene_size, scale)
    439 ]
    440 empty_labels = np.zeros(shape, dtype=np.uint8)
--> 441 self.add_labels(empty_labels, translate=np.array(corner), scale=scale)
        scale = <class 'numpy.ndarray'> (2,) float64
        corner = <class 'numpy.ndarray'> (2,) float64
        empty_labels = <class 'numpy.ndarray'> (512, 512) uint8
        self = Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Labels layer 'Labels' at 0x28e5d5610>], help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x16e39ed40>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})
        np = <module 'numpy' from '/Users/sobolp/micromamba/envs/napari-dev/lib/python3.11/site-packages/numpy/__init__.py'>

File ~/dev/napari/napari/components/viewer_model.py:5, in add_labels(self=Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoo...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), data=<class 'numpy.ndarray'> (512, 512) uint8, num_colors=49, features=None, properties=None, color=None, seed_rng=None, name=None, metadata=None, scale=<class 'numpy.ndarray'> (2,) float64, translate=<class 'numpy.ndarray'> (2,) float64, rotate=None, shear=None, affine=None, opacity=0.7, blending='translucent', rendering='iso_categorical', depiction='volume', visible=True, multiscale=None, cache=True, plane=None, experimental_clipping_planes=None, projection_mode='none')
      3 import inspect
      4 import itertools
----> 5 import os
      6 import warnings
      7 from functools import lru_cache

File <frozen _collections_abc>:1078, in append(self=[<Labels layer 'Labels' at 0x28e5d5610>], value=<Labels layer 'Labels'>)

File ~/dev/napari/napari/components/layerlist.py:195, in LayerList.insert(self=[<Labels layer 'Labels' at 0x28e5d5610>], index=0, value=<Labels layer 'Labels'>)
    193 new_layer.events.extent.connect(self._clean_cache)
    194 new_layer.events._extent_augmented.connect(self._clean_cache)
--> 195 super().insert(index, new_layer)
        new_layer = <Labels layer 'Labels' at 0x28e5d5610>
        index = 0

File ~/dev/napari/napari/utils/events/containers/_selectable_list.py:68, in SelectableEventedList.insert(self=[<Labels layer 'Labels' at 0x28e5d5610>], index=0, value=<Labels layer 'Labels'>)
     67 def insert(self, index: int, value: _T):
---> 68     super().insert(index, value)
        index = 0
        value = <Labels layer 'Labels' at 0x28e5d5610>
     69     if self._activate_on_insert:
     70         # Make layer selected and unselect all others
     71         self.selection.active = value

File ~/dev/napari/napari/utils/events/containers/_evented_list.py:207, in EventedList.insert(self=[<Labels layer 'Labels' at 0x28e5d5610>], index=0, value=<Labels layer 'Labels'>)
    205 self.events.inserting(index=index)
    206 super().insert(index, value)
--> 207 self.events.inserted(index=index, value=value)
        index = 0
        value = <Labels layer 'Labels' at 0x28e5d5610>
        self.events.inserted = <napari.utils.events.event.EventEmitter object at 0x16ffb2910>
        self.events = <napari.utils.events.event.EmitterGroup object at 0x16ffb2210>
        self = [<Labels layer 'Labels' at 0x28e5d5610>]
    208 self._connect_child_emitters(value)

File ~/dev/napari/napari/utils/events/event.py:771, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'index': 0, 'value': <Labels layer 'Labels'>})
    768     self._block_counter.update([cb])
    769     continue
--> 771 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        self = <napari.utils.events.event.EventEmitter object at 0x16ffb2910>
        cb = <bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object at 0x16fef1b40>>
        pass_event = True
    772 if event.blocked:
    773     break

File ~/dev/napari/napari/utils/events/event.py:809, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    807     self.disconnect(cb)
    808     return
--> 809 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x16ffb2910>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        cb = <bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object at 0x16fef1b40>>
        (cb, event) = (<bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object at 0x16fef1b40>>, <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    810     self.ignore_callback_errors,
    811     self.print_callback_errors,
    812     self,
    813     cb_event=(cb, event),
    814 )

File ~/dev/napari/napari/utils/events/event.py:796, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    794 try:
    795     if event is not None:
--> 796         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        cb = <bound method QtViewer._on_add_layer_change of <napari._qt.qt_viewer.QtViewer object at 0x16fef1b40>>
    797     else:
    798         cb()

File ~/dev/napari/napari/_qt/qt_viewer.py:659, in QtViewer._on_add_layer_change(self=<napari._qt.qt_viewer.QtViewer object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    651 """When a layer is added, set its parent and order.
    652 
    653 Parameters
   (...)
    656     The napari event that triggered this method.
    657 """
    658 layer = event.value
--> 659 self._add_layer(layer)
        layer = <Labels layer 'Labels' at 0x28e5d5610>
        self = <napari._qt.qt_viewer.QtViewer object at 0x16fef1b40>

File ~/dev/napari/napari/_qt/qt_viewer.py:669, in QtViewer._add_layer(self=<napari._qt.qt_viewer.QtViewer object>, layer=<Labels layer 'Labels'>)
    661 def _add_layer(self, layer):
    662     """When a layer is added, set its parent and order.
    663 
    664     Parameters
   (...)
    667         Layer to be added.
    668     """
--> 669     vispy_layer = create_vispy_layer(layer)
        layer = <Labels layer 'Labels' at 0x28e5d5610>
    671     # QtPoll is experimental.
    672     if self._qt_poll is not None:
    673         # QtPoll will call VipyBaseImage._on_poll() when the camera
    674         # moves or the timer goes off.

File ~/dev/napari/napari/_vispy/utils/visual.py:88, in create_vispy_layer(layer=<Labels layer 'Labels'>)
     86 for layer_type, visual_class in layer_to_visual.items():
     87     if isinstance(layer, layer_type):
---> 88         return visual_class(layer)
        visual_class = <class 'napari._vispy.layers.labels.VispyLabelsLayer'>
        layer = <Labels layer 'Labels' at 0x28e5d5610>
     90 raise TypeError(
     91     trans._(
     92         'Could not find VispyLayer for layer of type {dtype}',
   (...)
     95     )
     96 )

File ~/dev/napari/napari/_vispy/layers/labels.py:199, in VispyLabelsLayer.__init__(self=<napari._vispy.layers.labels.VispyLabelsLayer object>, layer=<Labels layer 'Labels'>, node=None, texture_format='r8')
    198 def __init__(self, layer, node=None, texture_format='r8') -> None:
--> 199     super().__init__(
        layer = <Labels layer 'Labels' at 0x28e5d5610>
        node = None
        texture_format = 'r8'
    200         layer,
    201         node=node,
    202         texture_format=texture_format,
    203         layer_node_class=LabelLayerNode,
    204     )
    206     # self.layer.events.color_mode.connect(self._on_colormap_change)
    207     self.layer.events.labels_update.connect(self._on_partial_labels_update)

File ~/dev/napari/napari/_vispy/layers/image.py:115, in VispyImageLayer.__init__(self=<napari._vispy.layers.labels.VispyLabelsLayer object>, layer=<Labels layer 'Labels'>, node=None, texture_format='r8', layer_node_class=<class 'napari._vispy.layers.labels.LabelLayerNode'>)
    108 self.layer.events.custom_interpolation_kernel_2d.connect(
    109     self._on_custom_interpolation_kernel_2d_change
    110 )
    112 # display_change is special (like data_change) because it requires a self.reset()
    113 # this means that we have to call it manually. Also, it must be called before reset
    114 # in order to set the appropriate node first
--> 115 self._on_display_change()
        self = <napari._vispy.layers.labels.VispyLabelsLayer object at 0x28e5fd510>
    116 self.reset()
    117 self._on_data_change()

File ~/dev/napari/napari/_vispy/layers/image.py:142, in VispyImageLayer._on_display_change(self=<napari._vispy.layers.labels.VispyLabelsLayer object>, data=<class 'numpy.ndarray'> (1, 1) uint8)
    140 for overlay_visual in self.overlays.values():
    141     overlay_visual.node.parent = self.node
--> 142 self.reset()
        self = <napari._vispy.layers.labels.VispyLabelsLayer object at 0x28e5fd510>

File ~/dev/napari/napari/_vispy/layers/image.py:259, in VispyImageLayer.reset(self=<napari._vispy.layers.labels.VispyLabelsLayer object>, event=None)
    257 super().reset()
    258 self._on_interpolation_change()
--> 259 self._on_colormap_change()
        self = <napari._vispy.layers.labels.VispyLabelsLayer object at 0x28e5fd510>
    260 self._on_contrast_limits_change()
    261 self._on_gamma_change()

File ~/dev/napari/napari/_vispy/layers/labels.py:254, in VispyLabelsLayer._on_colormap_change(self=<napari._vispy.layers.labels.VispyLabelsLayer object>, event=None)
    250     colormap = LabelColormap(**colormap.dict())
    251     colormap.background_value = (
    252         colormap._background_as_minimum_dtype(raw_dtype)
    253     )
--> 254 color_texture = _select_colormap_texture(
        colormap = LabelColormap(colors=<class 'napari.utils.color.ColorArray'> (50, 4) float32, name='label_colormap', interpolation=<ColormapInterpolationMode.ZERO: 'zero'>, controls=<class 'numpy.ndarray'> (51,) float64, use_selection=False, selection=1, background_value=0, seed=0.5)
        view_dtype = dtype('float64')
        raw_dtype = dtype('float64')
    255     colormap, view_dtype, raw_dtype
    256 )
    257 self.node.cmap = LabelVispyColormap(
    258     colormap, view_dtype=view_dtype, raw_dtype=raw_dtype
    259 )
    260 self.node.shared_program['texture2D_values'] = Texture2D(
    261     color_texture,
    262     internalformat='rgba32f',
    263     interpolation='nearest',
    264 )

File ~/dev/napari/napari/_vispy/layers/labels.py:189, in _select_colormap_texture(colormap=LabelColormap(colors=<class 'napari.utils.color....False, selection=1, background_value=0, seed=0.5), view_dtype=dtype('float64'), raw_dtype=dtype('float64'))
    186     color_texture = colormap._get_mapping_from_cache(raw_dtype)
    188 if color_texture is None:
--> 189     raise ValueError(  # pragma: no cover
        raw_dtype = dtype('float64')
        view_dtype = dtype('float64')
    190         f"Cannot build a texture for dtype {raw_dtype=} and {view_dtype=}"
    191     )
    192 return color_texture.reshape(256, -1, 4)

ValueError: Cannot build a texture for dtype raw_dtype=dtype('float64') and view_dtype=dtype('float64')


```

</details>

A layer is made but it's not functional:
![image](https://github.com/napari/napari/assets/76622105/98509c3b-756a-4e49-84b0-d82c3d26811e)

Quitting the viewer results in another traceback, but probably just due to the broken layer.

<details>

```
KeyError                                  Traceback (most recent call last)
File ~/dev/napari/napari/_qt/qt_main_window.py:580, in _QtMainWindow.closeEvent(self=<napari._qt.qt_main_window._QtMainWindow object>, event=<PyQt6.QtGui.QCloseEvent object>)
    577 self._qt_viewer.dims.stop()
    579 if self._quit_app:
--> 580     quit_app_()
        quit_app_ = <function quit_app at 0x16cf45760>
    582 event.accept()

File ~/dev/napari/napari/_qt/qt_event_loop.py:232, in quit_app()
    230 """Close all windows and quit the QApplication if napari started it."""
    231 for v in list(Viewer._instances):
--> 232     v.close()
        v = Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=10.0), dims=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x16cc9ed40>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})
    233 QApplication.closeAllWindows()
    234 # if we started the application then the app will be named 'napari'.

File ~/dev/napari/napari/viewer.py:148, in Viewer.close(self=Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoo...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}))
    146 self._layer_slicer.shutdown()
    147 # Remove all the layers from the viewer
--> 148 self.layers.clear()
        self = Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=10.0), dims=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x16cc9ed40>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})
        self.layers = []
    149 # Close the main window
    150 self.window.close()

File <frozen _collections_abc>:1084, in clear(self=[])

File <frozen _collections_abc>:1106, in pop(self=[], index=-1)

File ~/dev/napari/napari/utils/events/containers/_evented_list.py:198, in EventedList.__delitem__(self=[], key=-1)
    196 item = parent._list.pop(index)
    197 self._process_delete_item(item)
--> 198 parent.events.removed(index=index, value=item)
        parent = []
        index = 0
        item = <Labels layer 'Labels' at 0x2918afad0>
        parent.events.removed = <napari.utils.events.event.EventEmitter object at 0x16e9aea10>
        parent.events = <napari.utils.events.event.EmitterGroup object at 0x16e9ae050>

File ~/dev/napari/napari/utils/events/event.py:771, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'index': 0, 'value': <Labels layer 'Labels'>})
    768     self._block_counter.update([cb])
    769     continue
--> 771 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='removed'>
        self = <napari.utils.events.event.EventEmitter object at 0x16e9aea10>
        cb = <bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object at 0x16e9d18d0>>
        pass_event = True
    772 if event.blocked:
    773     break

File ~/dev/napari/napari/utils/events/event.py:809, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='removed'>)
    807     self.disconnect(cb)
    808     return
--> 809 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x16e9aea10>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='removed'>
        cb = <bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object at 0x16e9d18d0>>
        (cb, event) = (<bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object at 0x16e9d18d0>>, <Event blocked=False handled=False native=None source=None sources=[] type='removed'>)
    810     self.ignore_callback_errors,
    811     self.print_callback_errors,
    812     self,
    813     cb_event=(cb, event),
    814 )

File ~/dev/napari/napari/utils/events/event.py:796, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='removed'>)
    794 try:
    795     if event is not None:
--> 796         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='removed'>
        cb = <bound method VispyCanvas._remove_layer of <napari._vispy.canvas.VispyCanvas object at 0x16e9d18d0>>
    797     else:
    798         cb()

File ~/dev/napari/napari/_vispy/canvas.py:594, in VispyCanvas._remove_layer(self=<napari._vispy.canvas.VispyCanvas object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='removed'>)
    592 layer = event.value
    593 layer.events.visible.disconnect(self._reorder_layers)
--> 594 vispy_layer = self.layer_to_visual[layer]
        layer = <Labels layer 'Labels' at 0x2918afad0>
        self.layer_to_visual = {}
        self = <napari._vispy.canvas.VispyCanvas object at 0x16e9d18d0>
    595 self.viewer.camera.events.disconnect(vispy_layer._on_camera_move)
    596 vispy_layer.close()

KeyError: <Labels layer 'Labels' at 0x2918afad0>

```
</details>

Good news is this does not affect 0.4.19rc3
but:
git bisect points to bb25bda71c1cbb2af4174cbb8963c645254173a3
which has been cherry picked to v0.4.19 branch. But I guess isn't part of rc3? Maybe it's some interaction with a different PR

### 💡 Steps to Reproduce

1. Open viewer
2. Click Labels button to make a new Labels layer

It's not just empty layers, this also fails:
```
import napari
from skimage import data
from scipy import ndimage as ndi

blobs = data.binary_blobs(length=128, volume_fraction=0.1, n_dim=3)
labeled = ndi.label(blobs)[0]
viewer = napari.Viewer()
viewer.add_labels(labeled, name='blob ID')
```
### 💡 Expected Behavior

No traceback, layer should work.

### 🌎 Environment

napari: 0.5.0a2.dev495+gd507dd64
Platform: macOS-14.1.2-arm64-arm-64bit
System: MacOS 14.1.2
Python: 3.11.7 | packaged by conda-forge | (main, Dec 15 2023, 08:41:36) [Clang 16.0.6 ]
Qt: 6.6.0
PyQt6: 
NumPy: 1.26.2
SciPy: 1.11.4
Dask: 2023.12.1
VisPy: 0.14.1
magicgui: 0.8.1
superqt: 0.6.1
in-n-out: 0.1.9
app-model: 0.2.4
npe2: 0.7.3

OpenGL:
  - GL version:  2.1 Metal - 88
  - MAX_TEXTURE_SIZE: 16384

Screens:
  - screen 1: resolution 2056x1329, scale 2.0
  - screen 2: resolution 2560x1440, scale 1.0

Settings path:
  - /Users/sobolp/Library/Application Support/napari/napari-dev_36963bf0846bfe99dcf4f566a2cc780b6a723afa/settings.yaml
Plugins:
  - napari: 0.5.0a2.dev495+gd507dd64 (77 contributions)
  - napari-console: 0.0.9 (0 contributions)
  - napari-svg: 0.1.10 (2 contributions)

### 💡 Additional Context

This is my `napari --info` for rc3 where this does not occur:
```
napari: 0.4.19rc3
Platform: macOS-14.1.2-arm64-arm-64bit
System: MacOS 14.1.2
Python: 3.11.7 | packaged by conda-forge | (main, Dec 15 2023, 08:41:36) [Clang 16.0.6 ]
Qt: 6.6.0
PyQt6: 
NumPy: 1.26.2
SciPy: 1.12.0rc1
Dask: 2023.12.1
VisPy: 0.14.1
magicgui: 0.8.1
superqt: 0.6.1
in-n-out: 0.1.9
app-model: 0.2.4
npe2: 0.7.3

OpenGL:
  - GL version:  2.1 Metal - 88
  - MAX_TEXTURE_SIZE: 16384

Screens:
  - screen 1: resolution 2056x1329, scale 2.0
  - screen 2: resolution 2560x1440, scale 1.0

Settings path:
  - /Users/sobolp/Library/Application Support/napari/napari-419_9f9c3b1d4cb071ffa9c3954dc49db19675ab479f/settings.yaml
Plugins:
  - napari: 0.4.19rc3 (77 contributions)
  - napari-console: 0.0.9 (0 contributions)
  - napari-svg: 0.1.10 (2 contributions)
  
```


Discussion:

Resolving patch:
diff --git a/napari/layers/image/_slice.py b/napari/layers/image/_slice.py
--- a/napari/layers/image/_slice.py
+++ b/napari/layers/image/_slice.py
@@ -103,7 +103,7 @@ def make_empty(
         shape = (1,) * slice_input.ndisplay
         if rgb:
             shape = shape + (3,)
-        data = np.zeros(shape)
+        data = np.zeros(shape, dtype=np.uint8)
         image = _ImageView.from_view(data)
         ndim = slice_input.ndim
         tile_to_data = Affine(


Test patch: