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

Cut by mask crop to the mask borders #18

Open
GXcells opened this issue Dec 14, 2023 · 1 comment
Open

Cut by mask crop to the mask borders #18

GXcells opened this issue Dec 14, 2023 · 1 comment

Comments

@GXcells
Copy link

GXcells commented Dec 14, 2023

Hi, when I use cut by mask, it gives an images which is cropped to the limit of the mask.
So at the end, the resulting image does not have anymore the original size because my "white" part of the mask does not touch the borders of the original image size.

Is there a way to cut image by a mask but keeping the original size? (using the force resize does not work because it distorts the image, and does not add back the pixels missing.

@GXcells
Copy link
Author

GXcells commented Dec 14, 2023

Ok found a solution by using "paste by mask "and using an empty image of the same size as the original as "image_base", then using the cut by mask output as "image_to_paste", and the mask as "mask".
But the problem is that the removed part of the image due to masking are now black and not transparent. Any solution?
EDIT: Ok solved the non transparent background by modifying the empty image node to create a RGBA image with "0" in channel a instead of a RGB image.

As a separate point, I don't understand the behavior of "paste by mask". How can this node understand how to paste at the right place whereas the image output from cut by mask is a different size than the original image?

Also if I only use "paste by mask" without using the output of "cut by mask", the resulting image is not properly aligned.

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

No branches or pull requests

1 participant