Paste into Active Layer
Open, NormalPublic

Description

Adds a new entry named "Paste into Active Layer" to the Edit menu.

This action pastes the image from the clipboard into the active layer or mask, then it activates the Transform tool, allowing the image to be placed as desired.

The layer is not erased under the pasted image, but the pasted image is mixed with the layer in the same way as when a selection is moved or transformed.

This task covers:

  • Basic example
  • Target group
  • Simplified workflows
  • Interaction details
  • Out of scope

Basic example

  1. Create a new document
  2. Set the opacity of "Paint Layer 1" to 50%
  3. Paint a stroke
  4. Select the painted area
  5. Copy to the clipboard

  1. Select "Paste into Active Layer" from the Edit menu. The image is pasted with the same opacity and the Transform tool is selected.
  2. Place the pasted image as desired
  3. Repeat steps 6-7

Target group

"Paste into Active Layer" is aimed at "intermediate" users who regularly edit images with one or more of these features:

  • Layer Opacity
  • Blending Modes (such as Multiply)
  • Transparency Masks
  • "Isolate Active Layer"
  • Animation

The feature is not directly aimed at "beginner" users, who can work with the regular "Paste" action without encountering major hurdles. It is also not aimed at "advanced" users who have a deep knowledge of the program and can work around difficult scenarios using the approaches mentioned below.

Simplified workflows

Currently, when the user selects a portion of an image and presses Ctrl+C, the pixels from the active paint layer or mask are copied to the clipboard. The user can then paste the pixels to a new paint layer using Ctrl+V and position the layer as desired. If needed, the new layer can be merged with the original using Ctrl+E.

With the current workflow:

  1. Any masks applied to the original layer are lost when merging.
  2. Similarly, when Layer Opacity is present and a selection is copied, the result will be a layer with opacity reset to 100%. The original pixels will still look transparent, while the pasted content will look opaque.
  3. When working in "Isolate Active Layer" mode, the previously active layer is made invisible, and the mode must be deactivated in order to see both the original layer and the pasted content before merging them.
  4. When working on a transparency mask, for example to duplicate part of it or to paste a pattern from an external image, it must first be converted to a regular layer. The pasted layer must be merged with the transparency mask, finally the layer merged in this way must be converted back to a transparency mask.
  5. When animating, a new layer is created with a single frame located at the same time as the originally copied frame, and the timeline must be edited manually to paste at a different time.

Most of these workflows appear sub-optimal, and this is especially noticeable when one of these paste operations must be repeated more than once. Some of them can be optimized individually, for example in case (5) the regular paste action can be changed to create a frame at the current time, or case (1) can be improved by setting the right layer opacity when pasting a selection. However, most of them would still be cumbersome, like in case (3) where the workaround for a paint layer would be to create a temporary layer group and then use "Isolate Active Group".

Some advanced users may also be able to use clone brushes in these situations, but this solution won't work when pasting images from other programs, and in general it requires setting aside the currently active paint brush.

"Paste into Active Layer" would instead allow users to achieve the desired result in one step, and may easily handle animation frames. For the latter, it can be a much more flexible way to handle the currently requested "copy selection to other frame" workflow in T1698, that would allow changing both spacing and timing at the same (Ctrl+C > Select target frame > "Paste into Active Layer").

Interaction details

This action is only enabled when the clipboard contains an image, and a paint layer or a mask is currently selected.

If the image in the clipboard was copied within Krita, it is initially pasted in the same position, otherwise it is centered in the canvas. This works in the same way as the regular "Paste" action.

If the image in the clipboard only contains fully transparent pixels, a message is shown on the canvas and no transformation is performed.

Out of scope

This proposal adds a new action to the Edit menu, but it does not change or add any new keyboard shortcuts or modifiers. If the menu entry is not used, the behavior of the rest of the program is unchanged.

As implemented, users who often need this feature can associate it to custom shortcuts, or re-assign the default Ctrl+Alt+V or Ctrl+V.

Code

A prototype has already been created and will be available as a merge request.

paolo created this task.Feb 28 2021, 1:32 PM
paolo triaged this task as Normal priority.
paolo added a comment.Feb 28 2021, 2:20 PM

Link to the merge request for the first prototype:

https://invent.kde.org/graphics/krita/-/merge_requests/732