Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

When pixels are moved, they get the layer opacity remultiplied into them, and their opacity is used to blend them into the target location in the same layer

Open logiclrd opened this issue 8 months ago • 9 comments

Description If you select a set of pixels in a layer, the Move Selected Pixels tool can be used to change their position within the layer. When the move operation completes and the pixels are deselected, they are recomposited into the layer. But, if the layer's opacity is not 100%, the pixels which were moved end up having the layer opacity remultiplied against them as part of the commit operation.

Similarly, if the pixels themselves are not 100% opaque, that opacity is used to blend them back into the layer they're being moved within. Committing a move should simply overwrite the pixels -- including the opacity, so that they bring the opacity they had where they were moved from but don't get blended back into their layer.

To Reproduce

  1. Create an image.

image

  1. Paste another image in as a new layer.

image

  1. Set the layer opacity to 50%.

image

  1. Select a region of pixels in the layer.

image

  1. Using the Move Selected Pixels tool, move the pixels to another location.

image

The problem is already apparent here, because the moved region is transparent and the part of the layer behind where the pixels have been moved to can be seen through the selection.

  1. Deselect the pixels to commit the move operation.

image

The pixels have been cut from the layer and then pasted into the new location, but the layer's opacity was included in the cut and applied in the paste. The destination for the paste, though, is the layer which has that opacity as a persistent property as well, so now the opacity is applied to those pixels twice. In addition, the newly-pasted pixels show through what was beneath them in the layer. They should have simply replaced the pixels in the layer. With respect to the paste operation, they should be 100% opaque.

Version Operating system: Ubuntu 24.04 Pinta version: 2.2 built from 60cabb813f8397fc9a2b4ab946ce373259d550db

logiclrd avatar May 28 '24 21:05 logiclrd