6

I'm trying to thicken lines with imagemagick. There is a description about how to do this here, but when I do it on my sample images they just stay the same or get rather weaker.

Examples given from imagemagick (that do not make lines thicker when I try):

convert man.gif -morphology Thicken '3x1+2+0:1,0,0' thick_right.gif
convert man_line.gif -morphology Thicken ConvexHull thick_line.gif

My Sample image

  • Does anyone know how to make the lines (or shapes) thicker/bolder?
  • also: how does the "command" '3x1+2+0:1,0,0' work?

1 Answer 1

5

It seems these "morphology"s are were made having a black background as a basis. Once the image is white-on-black, the transformation works. From the documentation:

It was original developed with binary (pure black and white) images in mind

Negate the colors (so that I have white on black):

convert black-on-white.png -negate white-on-black.png

Then do above transformation from the question. However, I had better results with following morphology:

convert white-on-black.png -morphology Dilate Octagon fat-white-on-black.png

Still, nice to have would be to have it work from different color schemes.

2
  • 5
    The article also says * 'Dilate' and 'Erode' are dual*, so you can operate on your original image with -morphology Erode Octagon .
    – meuh
    Commented Jul 30, 2016 at 8:59
  • 1
    convert black-on-white.png -morphology Erode Disk:2.0 fat-black-on-white.png
    – Adam
    Commented Jul 5, 2021 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .