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 in Top color mode selects fully transparent pixel from top layer #999

Closed
hsandt opened this issue Mar 21, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@hsandt
Copy link

hsandt commented Mar 21, 2024

Pixelorama version:
v0.11.3-stable

OS/device including version:
Linux Ubuntu 22.04

Issue description:
Currently, if you paint with transparent pixels (using a color whose alpha = 0), it will store transparent pixels on the layer, which are different from having no pixels at all (e.g. on a new layer or after erasure).

When using Color Picker in Pick mode: Top Color and a top layer contains transparent pixels over other layers containing some color C, when clicking on a transparent pixel, the transparent color will be selected.

While it is correct in theory (if a pixel on top layer has alpha = 1 it should be selected, so if alpha = 0 why not do the same?), it may be confusing for the user who uses fully transparent pixels like placeholders for erased pixels (a typical example is using Bucket + transparent color to fill an area with transparent pixels - instead, for true non-pixels you need to Magic Wand the area then Delete - but both seem to do the same), so I opened it as a bug.

I suggest to simply ignore fully transparent pixels when using Color Picker with Top Color pick mode.

If you really want to keep the current behavior for people who need it, you could also add an option.

Alternatively, there could be an option to always erase pixels and never store "fully transparent pixels".

If it's not considered a bug and you need a feature request to actually add options and alternative behaviors, see this discussion instead: #998

Steps to reproduce:

  1. Create new document
  2. Create a second layer
  3. Fill bottom layer with some opaque color, e.g. blue, with Bucket Fill (B)
  4. Select top layer
  5. Fill bottom layer with some fully transparent color, e.g. red with alpha = 0, with Bucket Fill (B)
  6. Click on document to fill transparent pixels everywhere
  7. Select Color pick, make sure that Pick mode is Top Color and pick color anywhere in document

Expected: pick opaque blue
Actual: pick transparent color (red hue)

@hsandt hsandt added the bug Something isn't working label Mar 21, 2024
@OverloadedOrama
Copy link
Member

Thanks for reporting! The issue should be fixed now for both 1.0 (963819a) and 0.11.4 (fb95806)

Also, just a slight technical correction, there is no "having no pixels at all". Even the default transparency pixels, like ones that exist on new layers or on erasure, are still stored as fully transparent pixels, but they are black, meaning that all of the color channels (RGBA) are set to 0. The issue was that the color picker was checking for pixels that are equal to (0, 0, 0, 0), thus fully transparent pixels that are non-black were being included, resulting in the bug you reported. This has now changed and the color picker just checks if the alpha is set to 0, ignoring the RGB channels, which should fix the 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
Projects
None yet
Development

No branches or pull requests

2 participants