Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
border around layer using stroke selection
#1
I want to create a border around a picture (which is positioned inside a larger picture). I am trying to use stroke selection for this.

What i do, select the background as the active layer (the picture is a separate layer on top of this). Next use the select tool to select around the picture. Then [Edit]->[Stroke Selection] to draw a border around the image. The problem is, that the border is not only around the image. But also inside the image. Now that is not a problem if the image layer is 100% opaque. Because the image layer is blocking the stroke border underneath it. But if you make the image a little bit transparant, you will see the stroke selection border is also drawn inside the image.

So how do i fix this?

In other words: I want to draw a border fully around a layer (3mm wide), but not inside of it.

Thanks Smile
Reply
#2
If your initial layer has some transparency you will need some overlap. The pixels at the edge your initial object are partially transparent. If you create a smooth outline, its edge pixels will also be partially transparent. And partially transparent over partially transparent is not opaque but still somewhat partially transparent, so you will have a thin gap between the object and its outline.

Otherwise, Edit > Stroke selection doesn't give nice results (line if often a bit jerky), it is usually better to use Select > To Path and then Edit > Stroke path. In that case the path is drawn straddling the selection boundary, so if you keep the selection, you get one half of the path. If your selection is on your object, you get an inner outline and if the selection is outside the object, you get an outer outline. But with the restrictions above for the gap with the outer outline and an unwanted color blend on the edge for the inner outline.

My ofn-outline-layer script  attempts to do things correctly
Reply
#3
If it is a smaller layer over a larger layer I would introduce a new layer in between and size it to make the border.

Gimp is a raster editor and works in pixels so 3 mm can be exact or not depending on the pixels-per.xxx resolution. However the units can be changed during use if that is easier for you ....

1. Duplicate the small layer
2. Fill it with the border colour
3. Scale the layer. Layer -> Scale Layer set the units to millimetres, increase the width and height + 6 mm (3 mm all round)

example: https://i.imgur.com/xhcSN4q.mp4
Reply


Forum Jump: