Bug 392949 - Color Picker returns wrong color for certain colors
Summary: Color Picker returns wrong color for certain colors
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: 4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-09 21:36 UTC by hawaiigames
Modified: 2018-05-13 16:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Video showing the problem for various colors (3.58 MB, video/mp4)
2018-04-09 21:36 UTC, hawaiigames
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hawaiigames 2018-04-09 21:36:11 UTC
Created attachment 111931 [details]
Video showing the problem for various colors

Using Krita 4.0.0 x64 Portable on Windows 7 x64

As the summary says, the color picker returns the wrong color when picking certains colors. This affects both the color picker tool and the color picker gotten with CTRL+LMB.

The color selector sometimes also displays the wrong color as even another wrong color.

The result will also differ depending on the brush used. Sometimes another color will at random mix in. 

Theoretical method to reproduce:
1) Draw on layer with any tool. Try a variety of colors.
2) Pick some of the colors and try drawing with them. Some if not most should be incorrect.
3) Also check the sliders and color selectors to see if the color indicated match up with either the color picked or the color that came out when you draw with it.
4) If the color selector and/or the color sliders display the wrong color, try nudging any value. They should 'pop' from that wrong color into a slight variation of the picked wrong color.
5) Choose a different brush. The color will likely break right away, in my case most often be full alpha.
6) Change the color in the selector and try the brush. Then pick another color.
7) The color returned might be wrong, but not necessarily the same wrong color as with the previous brush.
8) Depending on the type of brush and color, other colors or transparency might randomly mix in.


I tried to illustrate the whole issue and reproduction process in the attached video.
Comment 1 Halla Rempt 2018-04-28 10:34:36 UTC
The color picker samples all the colors under the area the brush tip covers -- maybe that's what is happening?
Comment 2 hawaiigames 2018-04-28 15:26:01 UTC
(In reply to Boudewijn Rempt from comment #1)
> The color picker samples all the colors under the area the brush tip covers
> -- maybe that's what is happening?

It might be related insofar that the root of the issue lies in the code picking the color from area covered by the brush tip, but as far as my tests go, I don't think it's just a logical consequence of that feature. I've tried with different brushes and brush sizes, and the results are always the same.

As mentioned, the color returned sometimes has an Alpha of 0, or more often is not related in any way to any color on the layer or on the canvas, even when the whole layer was previously bucket-filled with a single color.

The only thing I noticed while testing your suggestion is that the channel values indicated in the 'Tool Options' for the color picker tool are actually correct, i.e when picking a pure blue it lists:

CHANNELS__|_VALUE
RED_________0
GREEN_______0
BLUE________1

The color sent to the color selector however is completely different.
Comment 3 hawaiigames 2018-05-13 16:18:31 UTC
This issue seems fixed as of 4.0.3.