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

Paste RGBA image over another RGBA image without completely overwriting pixels? #32

Open
HyperCodec opened this issue Jun 8, 2024 · 3 comments

Comments

@HyperCodec
Copy link

HyperCodec commented Jun 8, 2024

I have an image with a transparent background that I'd like to paste over another, but doing so sets all the pixels layered under that background area to fully transparent instead of just not affecting those pixels.

Is there a part of the API to implement this sort of blending? If not (and not planned to be added) , how might I implement it manually?

@HyperCodec
Copy link
Author

I figured out alpha compositioning on my own but I will keep this issue open as a request to make it part of the library.

@jay3332
Copy link
Owner

jay3332 commented Jun 8, 2024

You must paste the image with an alpha mask (Paste::with_mask)

@jay3332
Copy link
Owner

jay3332 commented Jun 8, 2024

You can also use a paste overlay mode of OverlayMode::Merge

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

2 participants