08-24-2018, 07:18 PM
(08-24-2018, 06:01 PM)awan Wrote: I want something like grow/ shrink selection but for strokes. We specify how much to grow/ shrink.
Sorry for my BAD English.
I guessed so
So, the 2.10 technique, to get the path that is 10px inwards or outwards from your path:
- Stroke the path in line mode (new 2.10 API (*)) on a transparent layer, with a 20px width
- Alpha to selection: gimp_select_item(layer)
- Select>ToPath: plug_in_sel2path(image, drawable)
- That path has two strokes, one is inside, one is outside (how to tell: get the length, the shortest is inside)
(*) The new 2.10 API, the calls you'll have to use:
Code:
pdb.gimp_context_set_stroke_method(STROKE_LINE)
pdb.gimp_context_set_line_cap_style(...)
pdb.gimp_context_set_line_join_style(...)
pdb.gimp_context_set_line_miter_limit(...)
pdb.gimp_context_set_line_width(width)
pdb.gimp_drawable_edit_stroke_item(drawable, path)