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 subtraction #1482

Open
funnym0nk3y opened this issue Mar 16, 2021 · 9 comments
Open

Color subtraction #1482

funnym0nk3y opened this issue Mar 16, 2021 · 9 comments
Labels
Enhancement Feature requests and code enhancements Needs Decision This is something that should be discussed by community Plugin Issues related to plugins and API system

Comments

@funnym0nk3y
Copy link

Hey,

I really like using flameshot. But when copying stuff from my lecture notes, some of them have a background color, mostly to indicate something. It would be very nice, if there was an option to replace/subtract a color with another color.

e.g.
grafik 2021-03-16 14 48 31

@mmahmoudian mmahmoudian added Enhancement Feature requests and code enhancements Needs Decision This is something that should be discussed by community labels Mar 17, 2021
@borgmanJeremy
Copy link
Contributor

In my opinion this should be done in another tool like GIMP since it exceeds the scope of simple edits. But if the community feels otherwise we can add it.

My concerns are:

  1. It won't tie in very nicely with the simple annotation tools since it needs multiple settings (color to select, and color to replace with).
  2. Do we need to support fuzzy matching?

@mmahmoudian what are your thoughts?

@mmahmoudian
Copy link
Member

It is a cool feature, but I believe that this is slightly out of the scope of a screenshot tool. The biggest issue I see is other than the 2nd point of @borgmanJeremy is that we the have to get down to the rabbit hole of keeping the shadows or not and what is a proper threshold and etc. and if color matching should be continues or not. Even in Gimp/Krita/Photoshop this takes some efforts to get it right.

Perhaps this can be facilitated when/if we have the SVG output as then it more encourage user to use a proper photo-editing tool.

Might also be a nice to have @ZetaoYang and @ThePurple opinions.

@panpuchkov
Copy link
Contributor

From a first sight it looks interesting, but... It's not a "Photoshop" and shouldn't be.
What we shouldn't forget is to keep interface simple and do not make it overloaded with a huge number of buttons. Possibly we need to rethink its concept and make it more flexible and not overloaded at the same time.
Maybe add some kind of ComboBox. We already have a lot of buttons and I have a number of complaints from our team members for too overloaded interface and "jumping" buttons on small screenshots. I don't want to add anything more to current interface if it's not a killer feature.
I know, that we can hide buttons, but users usually don't want to do it.

@funnym0nk3y
Copy link
Author

funnym0nk3y commented Mar 17, 2021

I thought about your concerns too. It's true, that this is a feature which needs some tweaking for perfect results. Especially for pictures with a lot of detail. And thus adds complexity to the UI. But let me explain why I think it fits to flameshot nevertheless (at least in my usecase):

  • Usually my workflow is "on the fly", copying from a PDF to a document. Compared to GIMP, I don't need to create a new file insert the screenshot, remove/replace the color, export it to a file, import it in my document and the clear all created files. It would be easy and fast.
  • In most cases the color to remove is a solid, so less (usually no) tweaking should be necessary for good results. For perfect results there is still the GIMP route.

Some basic tweaking options could be integrated in the color menu (I don't know the name, the one that pops up on the left).

@holazt
Copy link
Member

holazt commented Mar 18, 2021

From a first sight it looks interesting, but... It's not a "Photoshop" and shouldn't be.
What we shouldn't forget is to keep interface simple and do not make it overloaded with a huge number of buttons. Possibly we need to rethink its concept and make it more flexible and not overloaded at the same time.
Maybe add some kind of ComboBox. We already have a lot of buttons and I have a number of complaints from our team members for too overloaded interface and "jumping" buttons on small screenshots. I don't want to add anything more to current interface if it's not a killer feature.
I know, that we can hide buttons, but users usually don't want to do it.

It's possible to improve the response speed of capturing by automatically reloading dlls periodically.

@mmahmoudian
Copy link
Member

@funnym0nk3y I just made the following for myself and mapped it to a keyboard shortcut. It let you select the region, then it passes it to ImageMagic to remove the "white" background color and make it transparent and then passes it to xclip which puts it in clipboard as PNG:

flameshot gui -r | convert png:- -trim -transparent white png:- | xclip -selection clipboard -t image/png

You can also add -fuzz X% where X is the tolerance for the "white" color.

This is the result of my command when replacing the white with that yellow:

flameshot gui -r | convert png:- -trim -transparent \#fff7ab png:- | xclip -selection clipboard -t image/png

image

@kpcee
Copy link

kpcee commented Mar 19, 2021

Lately there are more and more suggestions for functions that are so specific that hardly anyone will use them. For such special functions a kind of plugin interface could be created that can manage and execute shell scripts. Scripts that can change the images via external programs like ImageMagick. This way you could enable special effects like watermarks, shadow effects, black and white photos ...
Otherwise, Flameshot essentially already offers all the necessary functions to edit screenshots well and should be oriented to other programs such as Shutter.

In my opinion, it would make much more sense in optimizing the existing functions and the GUI. The ever-changing interface by self-arranging buttons are just one possibility. The settings dialog could also be clearer and in Shutter it's possible to load images and make changes whenever you want and objects can be modified in position and size, not only undo and redo. There is still a lot of room for improvement, but any special effects that only make the program unnecessarily complicated and bloated, I would refrain. Just my opinion.

@nom3ad
Copy link

nom3ad commented Mar 30, 2021

@funnym0nk3y I just made the following for myself and mapped it to a keyboard shortcut. It let you select the region, then it passes it to ImageMagic to remove the "white" background color and make it transparent and then passes it to xclip which puts it in clipboard as PNG:

flameshot gui -r | convert png:- -trim -transparent white png:- | xclip -selection clipboard -t image/png

You can also add -fuzz X% where X is the tolerance for the "white" color.

This is the result of my command when replacing the white with that yellow:

flameshot gui -r | convert png:- -trim -transparent \#fff7ab png:- | xclip -selection clipboard -t image/png

image

Is it possible to define custom command action buttons? That would be really cool I guess. Users can easily extend functionalities using external scripts.

@mmahmoudian
Copy link
Member

mmahmoudian commented Mar 30, 2021

@nom3ad No, you cannot define custom actions for buttons inside Flameshot, but you can (as I demonstrated) use Flameshot in your scripts and trigger them using keyboard shortcuts. For example for me the Ctrl Shift Prntscrn triggers this command that I shared here to remove white background.

There has been some discussions about extensibility of Flameshot and add a plug-in system but it s still in early phases and we haven't decided to add it or not.

@mmahmoudian mmahmoudian added the Plugin Issues related to plugins and API system label Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and code enhancements Needs Decision This is something that should be discussed by community Plugin Issues related to plugins and API system
Projects
None yet
Development

No branches or pull requests

7 participants