ImageMagick: How to thicken lines

image manipulationimagemagick

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" '3×1+2+0:1,0,0' work?

Best Answer

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.

Related Question