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

[request] Blur tool #17

Closed
cyrinux opened this issue May 27, 2020 · 16 comments · Fixed by #19
Closed

[request] Blur tool #17

cyrinux opened this issue May 27, 2020 · 16 comments · Fixed by #19
Labels
enhancement New feature or request

Comments

@cyrinux
Copy link

cyrinux commented May 27, 2020

Hi,

First thanks for this cool project !

Cool you please add the basic blur tool in swappy?

Best regards

@jtheoof
Copy link
Owner

jtheoof commented May 28, 2020

Thanks for the feedback @cyrinux . Snappy on macOS does not have a blur tool. Could you describe a little more what you'd want?

@cyrinux
Copy link
Author

cyrinux commented May 28, 2020

Hi @jtheoof , I use before ksnip https://github.com/ksnip/ksnip you can see on this page a presentation of some tool.
Bluring tool is to hide a sensible information for example, you see?
Ksnip was really good but too many deps from kde for me and @maximbaz ;)
Tell me if you need more information.

image

@cyrinux cyrinux changed the title Blur tool [request] Blur tool May 28, 2020
@jtheoof
Copy link
Owner

jtheoof commented May 30, 2020

Thanks @cyrinux I'll see how I can do that with cairo

@jtheoof jtheoof added the enhancement New feature or request label May 30, 2020
jtheoof added a commit that referenced this issue Jun 1, 2020
The blur algorithm is largely inspired from Kristian Høgsberg & Chris
Wilson in [this file](https://www.cairographics.org/cookbook/blur.c/)

Closes #17
jtheoof added a commit that referenced this issue Jun 1, 2020
The blur algorithm is largely inspired from Kristian Høgsberg & Chris
Wilson in [this file](https://www.cairographics.org/cookbook/blur.c/)

Closes #17
jtheoof added a commit that referenced this issue Jun 1, 2020
The blur algorithm is largely inspired from Kristian Høgsberg & Chris
Wilson in [this file](https://www.cairographics.org/cookbook/blur.c/)

Closes #17
jtheoof added a commit that referenced this issue Jun 1, 2020
The blur algorithm is largely inspired from Kristian Høgsberg & Chris
Wilson in [this file](https://www.cairographics.org/cookbook/blur.c/)

Closes #17
@jtheoof jtheoof closed this as completed in fae0aea Jun 1, 2020
@jtheoof
Copy link
Owner

jtheoof commented Jun 1, 2020

@cyrinux I hacked around blur and cairo over the weekend. It's not perfect, cursor and performance need some more love. But should do the trick if you don't abuse blurring.

image

Let me know what you think.

@cyrinux
Copy link
Author

cyrinux commented Jun 1, 2020

Hi @jtheoof , thanks !
That make the job 🥳 , I hope you appreciate my entertainment suggestion 🤣 .

After I can suggest to make it even better:

  • Add possibility to draw a bluring rectangle, to be able to quick and neat blur a text zone for example.(this will maybe help for my second point above)
  • About performance, on laptop with my trackpad, sometimes I feel my finger move is smooth but this create no-blurred hole all on my way, I understand this depend on the speed, don't know what you can do for this.
  • The drop water icon need maybe gray polishing as other tools?
    image

Thanks you very much its already functional ;) 💯

@maximbaz
Copy link

maximbaz commented Jun 1, 2020

Thank you very much @jtheoof! I'll add just a couple of points from my side too:

  1. I agree that a blur rectangle would be a better implementation than a blur brush, more often one needs to hide sensitive area of the screenshot, let that be some text or a picture, and it's much much faster to draw a rectangle, inside which everything must get blurred. Maybe this will even be more efficient performance-wise, if you know the rectangle in advance, instead of following the cursor?

  2. The math on scaled displays seems to be currently off, I have 2.5 scale, and when I drag a mouse cursor with blur tool, the blurring happens in a different place of the screenshot, not where my mouse cursor is 🙂

@jtheoof
Copy link
Owner

jtheoof commented Jun 1, 2020

Thanks for the feedback guys, I'll reopen the issue and work on improving the blurring in future work.

@jtheoof jtheoof reopened this Jun 1, 2020
jtheoof added a commit that referenced this issue Jun 2, 2020
Use a rectangle to blur instead of brushes.

Does not improve the performance that much, will come in a later patch.

Will fix the UX of the feature though.

Closes #17
jtheoof added a commit that referenced this issue Jun 2, 2020
Use a rectangle to blur instead of brushes.

Does not improve the performance that much, will come in a later patch.

Will fix the UX of the feature though.

Closes #17
jtheoof added a commit that referenced this issue Jun 2, 2020
Use a rectangle to blur instead of brushes.

Does not improve the performance that much, will come in a later patch.

Will fix the UX of the feature though.

Closes #17
@jtheoof
Copy link
Owner

jtheoof commented Jun 2, 2020

I've added a more natural rectangle-ish aspect to the blur. @cyrinux @maximbaz if you give it a try and le me know :) I removed the blur as brush aspect.

I created #20 to track performance issues.

@maximbaz
Copy link

maximbaz commented Jun 2, 2020

Thank you very much @jtheoof! I can tell you that the "usage experience" is just perfect now, rectangle is truly what we needed. It works well on my scaled display as well now 👍

If you are still not sick of us and seeking for further improvement ideas (😄), one thing I would change is "strength" of the blur. Here's an example of me applying blur N times to try to hide the text, I would argue that even after 5 times the blurred text can be recognized.

image

I have two ideas: either simply play with constants to make the blur a lot more aggressive, or replace blur with pixelate algorithm? A random example of what it might look like:

image

@cyrinux
Copy link
Author

cyrinux commented Jun 2, 2020

Hi, thanks @jtheoof ,
I want to do the same remark as @maximbaz about the strengh of the blur.
Other things are good !

@maximbaz
Copy link

maximbaz commented Jun 2, 2020

I just saw that blur level is actually configurable, with 500 being the max value. I would argue that even that is not enough, and blurring 5 times with level 500 is still quite "readable" (especially if you can guess the pattern of the text being hidden), but 10 times 500 level is what I would already consider enough for hiding a sensitive content 🙂

image

@jtheoof
Copy link
Owner

jtheoof commented Jun 3, 2020

OK thanks I'll play around to provide more effective blur.

EDIT: The problem is more noticeable on scaled displays because the fonts are so crisp. Takes more pass to actually blur effectively. I'll think of a more UI friendly way to blur than just smashing the blur level + button.

@jtheoof
Copy link
Owner

jtheoof commented Jun 3, 2020

See #22

@jtheoof
Copy link
Owner

jtheoof commented Jun 13, 2020

@cyrinux @maximbaz With #25 I've done some improvements with bluring algo and rendering. Should now be much smoother and scale well on High DPI displays. Let me know what you think.

@cyrinux
Copy link
Author

cyrinux commented Jun 14, 2020

Hi @jtheoof cool yes its smoother for me, and icon is better :-)

@maximbaz
Copy link

I agree @jtheoof, it is amazing now, thank you once again for your improvements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants