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

Create "Mix" node #2580

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Create "Mix" node #2580

wants to merge 4 commits into from

Conversation

mrjschulte
Copy link
Contributor

This node allow let the user do a quick and simple mix (otherwise known as a dissolve/fade) between two input images.

This node allow let the user do a quick and simple mix (otherwise known as a dissolve/fade) between two input images.
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the mixing itself: it's only correct for images with premultiplied alpha. This is a problem because we use straight alpha everywhere.

I think the best solution would be to have a "Separate Alpha" setting like for Resize. Basically, if "Separate Alpha" is checked, we assume that the alpha channel is independent of the color channels. This allows us to use (1 - mix) * input1 + mix * input2 directly if checked. Otherwise, we have to multiply by alpha.

What do you think?

…ng/mix.py

Co-authored-by: Michael Schmidt <msrd0000@gmail.com>
@mrjschulte
Copy link
Contributor Author

I can see your proposal working and being useful in the current Ux for a lot of the chaiNNer workflows out there. I need to look at it from typical user's pov where they don't really want/need to have to deal with anything at that granular of a level besides just getting their chain to run and for the output to be predictable.

Quite the opposite to a more informed, technical and also usually much more complex chain structure where the user would need and want to be aware of premultiplied RGB and other items.

@mrjschulte mrjschulte marked this pull request as draft February 12, 2024 19:45
@mrjschulte
Copy link
Contributor Author

Straight alpha really needs to go :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants