-
Notifications
You must be signed in to change notification settings - Fork 13
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
Erase only parts an eraser brush? (images) #50
Comments
This is definitely something I would like to have bulit-in as a part of If implementing this as an outside library, one way to do this would be to
For how to add/remove tools, see this example.
Use A list of all supported events can be found here.
See To auto-resize the image, use // For some editor
editor.dispatch(editor.image.setAutoresizeEnabled(true)); |
Thank you for your response. If I understand correctly, your described method will enable a user to erase in shapes like lines (essentially by re-rendering them), but not be able to erase parts of an image layer. Is that correct? The main reason to want an eraser is the ability to erase in image layers. Wouldn't this simply be something like a "transparent brush"? on the level of canvas. My use case for js-draw is to hopefully create an inpaint/outpaint interface. Inpainting means erasing a part of an image and then filling up the empty space (usually with AI). My AI platform already has a backend that does all that. All it needs is a source image and a mask image. (the mask image being the area that needs to be replaced) I figured all I need is
I really like js-draw for its simplicity and its ability to automatically select only the area with actual content in it, which is exactly what you want in an 'infinite' outpainting canvas. I am not a front-ender by any stretch of the imagination so I'm hoping that I can hack together a prototype without having to design the whole thing from scratch. Here is an example of such an interface that I'm describing. This particular interface uses a "selection frame" the user can move around like a layer to specifiy which part needs to be inpainted. Also in this particular interface, once a layer is blurred (unselected), it is merged with the rest and can not be moved anymore. brush.mp4Is it reasonable to want to use js-draw to realize this or should I look for something else? |
This should be easier than creating a stroke eraser, but perhaps still more limited that is ideal. This would be easier if One way to do this in
|
Thanks for your response. I will have to look at it later, right now what you are describing is too complicated since I'm not familiar with all of your APIs. |
Re-opening — the original issue is related to images. Only partial stroke erasing has been implemented. |
How would I go about adding an eraser button that erases only where you move the mouse, like a traditional eraser 'brush'?
Additionally I don't understand yet how js-draw implements events, or how to access the EventDispatcher.
For example, how do I set an event listener "on blur" on every layer so that as soon as a new layer is added/unfocused, all layers are merged into one and the editor image is resized to the size of the resulting layer?
The text was updated successfully, but these errors were encountered: