Converting a Striped Font in a Solid Font

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
devman2012
Posts: 2
Joined: 2012-11-09T06:53:33-07:00
Authentication code: 67789

Converting a Striped Font in a Solid Font

Post by devman2012 »

Hello people!
I'm new in the forum.

I hope that somebody could help me. So, I'll go directly to the point.

I need some processing to covert this striped/lined (vertical lines) font into a solid/filled font.

Here is my original image (input).
Image


Here, generated image with IM. (With a lot of noise)
Image


And this, the expected image (edited with Gimp).
Image


I'm using this script/command-line:

Code: Select all

convert   inputFileName \
          -black-threshold 40% \
          -white-threshold 45% \
          -despeckle \
          -deskew 50% \
          -morphology Open Octagon:3 \
          -morphology Erode Octagon:3 \
          outputFileName
So, any help?



Thank you!



Best regards,
devman2012
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting a Striped Font in a Solid Font

Post by fmw42 »

try this


convert 1test1originalx.jpg \
-bordercolor white -border 10 \
-threshold 11% \
-morphology open octagon:4 \
-blur 3x65000 -level 50%x100% \
-morphology dilate octagon:3 \
-gravity center -shave 10x10 \
1test1originalx_result.gif
devman2012
Posts: 2
Joined: 2012-11-09T06:53:33-07:00
Authentication code: 67789

Re: Converting a Striped Font in a Solid Font

Post by devman2012 »

I've tested with your script and worked. I will do more tests with other samples, giving here a feedback.

Thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting a Striped Font in a Solid Font

Post by fmw42 »

devman2012 wrote:I've tested with your script and worked. I will do more tests with other samples, giving here a feedback.

Thank you!

You may have to adjust some of the arguments that I tuned to this image.
Post Reply