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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color Picker Eyedropper does not pick the same Color as getting the Color from the image data #79348

Closed
ghost opened this issue Jul 11, 2023 · 2 comments · Fixed by #79350
Closed

Comments

@ghost
Copy link

ghost commented Jul 11, 2023

Godot version

4.1

System information

Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 30.0.101.1660) - 12th Gen Intel(R) Core(TM) i7-1260P (16 Threads)

Issue description

I made an image with only one color and no partially transparent tiles. When I get the list of all colors through code, I get one color. When I use the eyedropper on a color picker to get the same color, the color is different. For example, using a color of 23674e gets me (0.1373, 0.4039, 0.3059, 1) as the color from the image data, and (0.1367, 0.4023, 0.3047, 1) as the color from the color picker eyedropper. This is not close enough for Color.is_equal_approx to count it as the same color.

Steps to reproduce

  1. Make an image
  2. Get an array of colors from the image via the Image class
  3. Get a color from the image via the Color Picker eyedropper
  4. The color isn't in the array.

Minimal reproduction project

test.zip

@Calinou
Copy link
Member

Calinou commented Jul 11, 2023

The error is small enough that this sounds like a off-by-one error or rounding error, rather than a sRGB/linear conversion issue.

@dalexeev
Copy link
Member

This is not close enough for Color.is_equal_approx to count it as the same color.

Note that Image has different formats. Try to use Image.FORMAT_RGBAF, I had a similar error with unequal colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants