# dt 3.4: How to draw a closed straight sided path .

I’m having my usual learning difficulty with this activity, when trying to create a closed straight sided path in dt. Philosophically I’ve given up on trying to enclose an area with a 1 or 2 straight sided path on a plane (the ‘straight’ requirement is the difficulty). But surely it should be easy with 3 or more sides?

Even after an intense scrutiny of the official documentation, the key question remains: ‘how/where/when does one close the path to get all sides to be straight?’. My problem is that with use of the Ctrl key at various times, selected by trial and error (the ‘and’ always applies), I can generally create an ‘n’-sided closed path but only ‘n-2’ of the sides are straight. The first and last side are always Bezier-looking curves. I can correct that by clicking twice on the control point at the start of the path, with the Ctrl key pressed - but this shouldn’t be necessary, should it? I say this because, once in the last 30 or so attempts, I have created a multi-straight-sided figure directly - but I have no idea what I did ‘wrong’ to achieve this.

In addition I often find that one or more sides of the closed figure have short straight extensions ‘outside’ the path, as if the path drawing algorithm has overshot the apex and back-tracked on itself. What is causing this?

The path I create, whether straight-sided or not, ends up with a short-dashed line adjacent to every edge of the closed path. At first I thought this was an illustration of feathering with a radius of zero, but the short-dashed line remains adhering to the solid line no matter how much I try to increasing the feathering. Not only that, but the dashed line disappears as soon as I draw a second path - so it must be an ‘active-selection’ indicator - yes? If so, how does one apply a feather to the edge of a straight-sided path ?

What is it that you’re trying to achieve? Darktable has pretty good feathering, so it’s usually enough to roughly select the shape, and turn on feathering, increasing the opacity a bit; it detects and follows edges nicely.
See https://www.darktable.org/2018/12/darktable-26/ under Edge-aware bluring for blend masks.

@LateJunction

I’m not entirely sure what it is you are after, but I do think it is something like I show here:

My approach to do this is as follows:

• hold down ctrl,
• mouse-click on first point, keep ctrl pressed,
• repeat for next points
• click right mouse button

Done.

3 Likes

Ah, so! I had persuaded myself that a pixel-precise path round a rectilinear object (door, window, wall in perspective, etc) was required to produce an accurate mask. I certainly never tried ‘roughly selecting the shape’ or adjusting the opacity. Does dt really follow edges that closely? I must try it.

But could I also ask, as a purely ‘academic’ topic, how to achieve a closed straight-edged path simply ?

Yes, that’s the 4 steps which I had learned from the documentation, but because of some ham-fisted-ness (a newly created word, I believe) I always seem to end up with the first and last line segments curved.

Ill try it again.

(25 seconds later)

Dammit!

Having got that fixed, any comment on the feathering question ?

1 Like

darktable in general?
The video?

The dashed line does show the feathering boundary and it is only shown for the active mask.

I noticed way back that if it is set to 0 it might take a long time scrolling to get it to show up. To give you an idea, the following has a feather of, what I presume to be, 0. Very shortly after the video starts I start scrolling the mouse-wheel like crazy towards me while holding down shift:

This happens when you scroll away from you for too long (for whatever reason, a mistake easily made in my opinion) and it needs to go all the way back to a point that is actually visible. Rather annoying, but it is the way it is (a reset opportunity to a reasonable feather distance would be nice to have).

1 Like

The dashed line shows the outer limit of the featering (opacity = 0), the “feathering” slider makes the mask follow edges in the image (more or less). You can modfy the dashed line with shift-scroll, or by dragging the visible control points.
There’s also a third control: when you click on a control point on the main path, a line perpendicular to the path appears with a small handle at the end, that handle controls the “curviness” at the selected control point.

I found the best way to keep an eye on what happens is to show the mask by clicking on the icon to the right of the eye (bottom right of the module), and play a bit with the controls.

1 Like