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

Finally fixing the paint bucket tool #616

Open
maoschanz opened this issue Sep 3, 2023 · 0 comments
Open

Finally fixing the paint bucket tool #616

maoschanz opened this issue Sep 3, 2023 · 0 comments
Labels
bug Something isn't working enhancement ideas to improve existing features selection Everything related to the selection management tools bugs or suggestions related to tools

Comments

@maoschanz
Copy link
Owner

maoschanz commented Sep 3, 2023

Use case

using the paint bucket tool without crashes

Suggested solution

  • replace the very "beta" menu (with verbiage to select an algorithm) by a checkbox corresponding to user-oriented needs
    • fill with the request alpha channel (erase & replace) or not (outline & fill)
  • replace the current unreliable "magic path" algorithm with yet another idea that came to me in a dream:
    • from the point where the user clicked,
    • go in 8 directions until reaching the edge of the contiguously colored area.
    • incrementally refine each segment of the irregular octagon:
      • from the middle of each given segment,
      • go in the 3 possible directions only 2 directions for the first iteration, and then only the diagonal one (to avoid crossings) until reaching an edge

this would work despite the way cairo handles the matter

the "outline & fill" method can have cleaner edges if all points of the shape go "one pixel further" than needed, which is possible because that incremental building technique from an octagon mean we easily know which side of the edge is which at any given point

Possible drawbacks

  • what would happen to "select by color"?
  • could i keep the "entire image" option?

Possible alternatives

  • what about a "only contiguous pixels" checkbox option? when unchecked, replace a color across the entire image instead of running those idiotic costly python pathfinding algorithms
@maoschanz maoschanz added bug Something isn't working enhancement ideas to improve existing features tools bugs or suggestions related to tools selection Everything related to the selection management labels Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement ideas to improve existing features selection Everything related to the selection management tools bugs or suggestions related to tools
Projects
None yet
Development

No branches or pull requests

1 participant