Page 1 of 1

Converting a Striped Font in a Solid Font

Posted: 2012-11-09T06:59:35-07:00
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

Re: Converting a Striped Font in a Solid Font

Posted: 2012-11-09T11:33:35-07:00
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

Re: Converting a Striped Font in a Solid Font

Posted: 2012-11-09T12:27:56-07:00
by devman2012
I've tested with your script and worked. I will do more tests with other samples, giving here a feedback.

Thank you!

Re: Converting a Striped Font in a Solid Font

Posted: 2012-11-09T13:06:57-07:00
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.