-
Notifications
You must be signed in to change notification settings - Fork 232
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
Changed the MaskEditor to an Image Canvas #2921
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an interesting idea. But I just tried it and it does not seem to work? I drew on the image and saved my progress, but my drawing is not saved to the image. Also, I can't erase my drawing. You should also separate the drawing into its own layer so the user can toggle their drawing on/off.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
@trsommer It took me a few more hours to understand the intricacy of your MaskEditor code. The updated version should now paint on a separate layer (with a checkbox for visible / invisible). You are also now able to erase your painted features. When using the paintbrush, you can right click and draw to erase just painted features. When using the mask, you can right click and draw to erase just mask area. When using the eraser tool, it erases both. Also, it now saves properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, I appreciate you understanding my confusing mask editor code. It needs further refactoring. As you said, the saving works, and you can erase using the eraser tool.
There are a few more bugs that need fixing:
- The line eraser is triggered when erasing using the right mouse button while using the draw tool.
- The brush hardness for the mask tool is broken; the brush tool does not have it.
- Undo/redo does not work for the draw tool.
- I need a way to only erase the drawing or the mask part. The easiest solution would be to make the layer clickable to select which layer to work on.
- (There are UI changes I would like to make, but that is not important for now.)
- you need to adhere to the prettier code style
- Last but not least, I feel like the name change in the menu is confusing. If I am accustomed to the mask editor, I will not find it now. The name 'Image Canvas' does not convey mask editing to me. I think we should stay with 'Mask Editor' because mask editing is the main feature for now. In the future, I think the mask editor and a potential image editor should be split.
@trsommer Thank you for the comments. I've put comments below, but most importantly, in the prior update, I was flattening the rgbCanvas and the base imageCanvas into one image (and using that as the ref for the mask) in order to re-use the mask loading structure. I've since removed that functionality because it does not allow the user to re-edit their painting after saving (since the painting is flattened with the image). I would like to save the painting (rgbCanvas) separately, like the mask is saved separately, to retain the editability.
|
… Still need to figure out how to load the painted pixels onto RGB Canvas when the MaskEditor is re-opened after painting and saving
@trsommer I've pushed an update - the code now saves the rgbCanvas pixels to the input folder. So, now the code saves the mask image, a combined image with the mask and painted pixels, and an image with just the paint pixels. We still need to figure out how to load the painted pixels onto rgbCanvas when the MaskEditor is re-opened after painting and saving. After the initial painting and save, the node will process the combined image, meaning both the mask and the painting will get passed on. But, when the MaskEditor is re-opened (for further adjustment of mask/paint), the paint does not show up. |
@trsommer Have you had a chance to take a look? I think this is a very useful tool to have, but I'm currently stuck at being able to load the painted pixels because I'm not sure how to replicate the clipspace behavior that the mask image uses. It would be immensely helpful if you could help bring this over the finish line given your familiarity. |
@brucew4yn3rp Unfortunately, I haven't had a chance yet. I'm quite busy for the next two weeks, but I will look at it after that |
… them as part of the image. Maybe a combinedCanvas?
Thank you @trsommer. I've just pushed an updated file that adds an index to the Clipspace type, which allows for the persistence of the painted pixels. Now after the maskeditor is closed and re-opened, painted pixels are still editable. The only thing left to figure out now is how to pass the painted pixels + base image as the image in the node. I had some luck doing this with a combinedCanvas that draws the image and rgbCanvas but then we lose the mask. Whenever you have a chance, if you can take a look at that, I think that will be the last step to finalize this. |
Hi @trsommer - hope the past two weeks went well. Quickly following up on the final stage of the MaskEditor upgrade whenever you have a chance. Thank you. |
@brucew4yn3rp I looked into the issue. I honestly have no idea how to solve it. I achieved the same result as you, retaining the paint and mask layers, but I did not figure out how to output the painted image while retaining the original input image with mask and paint layers. I will try again tomorrow. |
#2888
Revamped the MaskEditor UI and changed it to an Image Canvas. The context menu name has also been renamed accordingly.
The interface now supports drawing on the image itself (on the image layer) in addition to covering the area with a mask. Users can select a color or use an eyedropper tool for color matching. As indicated in the Feature Request, this is a powerful tool to guide the image generation process post-masking.
The tools on the left sidebar have been updated accordingly. The top one, is the existing mask brush, and has a matching mask logo. The second one is the image painting brush.
┆Issue is synchronized with this Notion page by Unito