I import a jpg image in my notebook. The result is like this:

enter image description here

I'm interested in the outline so I wrote this code: ColorNegate[ EdgeDetect[ColorNegate[AlphaChannel[RemoveBackground[test]]]]]

The result is:

enter image description here

The outline is 1 pixel. I want to make the outline thicker, for example 2 pixels. How can I do that?


1 Answer 1


I would use Dilation for this.

im = Import["https://i.sstatic.net/bp3Ci.jpg"];

edges = EdgeDetect[AlphaChannel[RemoveBackground[im]]];

thickerEdges = Dilation[edges, 5]

this shows the bicycle edges after Dilation is applied


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.