Drawpile icon indicating copy to clipboard operation
Drawpile copied to clipboard

Selections: allow drawing on selections as if they were layers

Open askmeaboutlo0m opened this issue 1 year ago • 2 comments

With #1303, selections are persistent. Under the hood, they're actually a kind of layer, so it'd be technically possible to draw on them.

UI-wise, this would require presenting selections in the layer list, similar to the idea with floating transforms in #1266. It would also need some kind of "selection" blend mode that only pays attention to the alpha channel.

Protocol-wise, this could just be a new command (except on builtin servers, where we'd presumably need some PutImage hacks again), since it doesn't affect anything visible and so doesn't cause desync. Alternatively, it may be possible to hack something by using invalid blend modes, but I don't think that would work for MyPaint brushes. Although maybe there's some other invalid combination we could use for those to keep things compatible without adding a mound of new commands.

This feature doesn't have particularly high priority, since you can turn selections into layers (by using Fill Selection) and vice-versa (by using Layer to Selection) already.

askmeaboutlo0m avatar May 17 '24 22:05 askmeaboutlo0m

08c71ea645aa471e5aff4a1e7aa2519c (1) Huh krita does have this 'selection-pseudo-layer', Maybe it can be used in other things? Such as adding blend modes like in #211 . Just a idea though, since the layer is actually for selection not transformation.

amoruwu avatar May 18 '24 09:05 amoruwu

Would be pretty useful, both for drawing above selections, and under transformation. #1266 Here's how it is on GIMP: GIMP selection brush limit

MorrowShore avatar Jul 14 '24 14:07 MorrowShore

This is implemented for 2.3.0 now. It extends layer ids to have 24 bits instead of 16, which leaves plenty of room for a flag bit at the top that allows any layer id to refer to a selection.

Drawing on a selection is done by enabling Selection → Draw on Selection, similar to how GIMP does via the (weirdly-named) Select → Toggle Quick Mask action. I think that's better than sticking a pseudo-layer at the top of the layer tree, since it requires a lot of annoying scrolling when you have a lot of layers and looks kind of ugly to have such a rarely-needed thing sitting at the top of such an important dock.

(The two comments above aren't really about this feature, what they're showing is masking, which is tracked in #1433.)

askmeaboutlo0m avatar Apr 27 '25 22:04 askmeaboutlo0m