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

Fix Move Selected Pixels tool for layers with transparency and nonstandard blend modes #820

Conversation

logiclrd
Copy link
Contributor

This PR fixes the semantics of the Move Selected Pixels tool so that the pixels that are being relocated within their layer do not get the layer's Opacity and BlendMode baked into them -- and thus reapplied when the move operation is committed.

I'm pretty sure this is the right thing to do. See issue #819.

I'm not sure if this is the right way to do it. I'm not all that familiar with the codebase. :-) It seems to fix it for me, though.

The one thing is that the selection layer ends up floating above the selected layer with 100% opacity until the move is committed. It would be even better if the selection appeared as though already merged into the selected layer -- so, with respect to the selected layer, it's 100% opaque, but with respect to the rest of the image, it is respecting the selected layer's opacity/blend mode.

Before committing the move:

image

After committing the move:

image

Notice that the part of the moved pixels that extends into the hole it left behind isn't now 25% opacity, it matches the rest of the image. And, the pixels that were moved on top of the rest of the layer (e.g. partially covering the curly red feature) simply replace them, instead of being blended with them.

…acity with a Normal blend mode, since they're going to be merged back into the layer that has its persistent BlendMode and opacity anyway. See issue PintaProject#819.
@logiclrd logiclrd force-pushed the JDG_MovePixelsOpacityAndBlendMode branch from d2fd3f9 to 12be5dd Compare May 28, 2024 21:43
@logiclrd
Copy link
Contributor Author

The commit that this PR was originally made on inadvertently contained some whitespace changes to the comment block at the top. I didn't notice that Visual Studio Code was automatically deleting those spaces on save! In any case, I have fixed that.

@logiclrd
Copy link
Contributor Author

Hmm, it occurs to me that the same issue might still arise with an image where the pixels themselves are not fully-opaque, rather than the layer opacity being less than 100%. This might not actually fix the issue properly. I think properly fixing this may require special-casing the blending of the selection layer.

@logiclrd
Copy link
Contributor Author

Yep, confirmed. Will update #819 with further details.

@logiclrd logiclrd closed this May 28, 2024
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.

1 participant