Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect color in labels sidebar #2240

Closed
ianhi opened this issue Feb 9, 2021 · 4 comments
Closed

Incorrect color in labels sidebar #2240

ianhi opened this issue Feb 9, 2021 · 4 comments
Labels
bug Something isn't working vispy Vispy integration
Milestone

Comments

@ianhi
Copy link
Contributor

ianhi commented Feb 9, 2021

馃悰 Bug

When working in a labels layer for some colors when I use the eyedropper the color in the side bar is not correct:

Peek 2021-02-09 16-48

To Reproduce

Steps to reproduce the behavior:
I haven't figured out a minimal example but I am definitely running into this semi regularly

Expected behavior

The color in the side bar is the same as in viewer.

Environment

napari: 0.4.4
Platform: Linux-5.8.0-7630-generic-x86_64-with-glibc2.10
System: Pop!_OS 20.04 LTS
Python: 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0]
Qt: 5.12.9
PyQt5: 5.12.3
NumPy: 1.19.5
SciPy: 1.6.0
Dask: 2021.02.0
VisPy: 0.6.6

OpenGL:

  • GL version: 4.6 (Compatibility Profile) Mesa 20.2.6
  • MAX_TEXTURE_SIZE: 16384

Screens:

Plugins:

  • svg: 0.1.4

Additional context

@sofroniewn sofroniewn added this to the 0.4 milestone Feb 9, 2021
@sofroniewn sofroniewn added bug Something isn't working vispy Vispy integration labels Feb 9, 2021
@sofroniewn
Copy link
Contributor

Uh oh! That's not so good. The data to get to a color goes through two different paths to appear on the screen - one is via the CPU and then Qt for the color square on the left, the other is via the GPU and vispy for the label in the canvas. The nature of the colormap for labels is that small differences in input can lead to large differences in color space, which maybe makes the whole system more sensitive for rounding errors/ artifacts.

I haven't figured out a minimal example but I am definitely running into this semi regularly

Yeah, I think I've seen it too. It would be great to have a minimal example

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/napari-labels-layer-not-displaying-colormap-properly/70683/2

@perlman
Copy link
Contributor

perlman commented Aug 17, 2022

Here's some code to reproduce:

import napari
import numpy as np

viewer = napari.Viewer()
data = np.array([[24, 24],[ 24, 24]])

viewer.add_labels(data, name='labels')
viewer.layers[0].selected_label = 24

napari.run()

Notably, both the color picker color and thumbnail disagree with the label rendering.

I suspect this is similar to #4935, but with the random color side of the code.

@psobolewskiPhD
Copy link
Member

psobolewskiPhD commented Jun 11, 2023

The snippet from above does not result in any disagreement between the the thumbnail, screen, and picker:
image

Going to close this as solved by #4935. If it pops ups again with a new reproducer we can reopen or make a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vispy Vispy integration
Projects
None yet
Development

No branches or pull requests

5 participants