Page 2 of 2

Re: fill black color for an outline

Posted: 2015-09-26T23:35:15-07:00
by Amused23
My OCR accuracy is about 85% now. I can increase it to 95%-100%. The result of the commands in the previous post is the image below.
https://www.dropbox.com/s/0hmp1rc170l1j ... t.png?dl=0

The desirable result is the following image.
https://www.dropbox.com/s/g73qffwq7bm83 ... e.jpg?dl=0

Thanks.

Re: fill black color for an outline

Posted: 2015-09-27T11:17:45-07:00
by fmw42
try this:

Code: Select all

convert out.png -bordercolor white -border 1 \
-fill red -draw "color 0,0 floodfill" \
\( -clone 0 -fill white +opaque black -negate \) \
\( -clone 0 -fill black +opaque white \) \
-delete 0 -compose plus -composite -negate \
result.png

Re: fill black color for an outline

Posted: 2015-09-27T20:49:42-07:00
by Amused23
Nope...doesn't work.

Re: fill black color for an outline

Posted: 2015-09-27T23:06:55-07:00
by fmw42
The code works for me in IM 6.9.2.3 Q16 Mac OSX (unix syntax below)

input:
Image

Code: Select all

convert out.png -bordercolor white -border 1 \
-fill red -draw "color 0,0 floodfill" \
\( -clone 0 -fill white +opaque black -negate \) \
\( -clone 0 -fill black +opaque white \) \
-delete 0 -compose plus -composite -negate -shave 1x1 \
result.png
Image

If on Windows, see http://www.imagemagick.org/Usage/windows/ for syntax differences

P.S. IM 6.7.7.10 was not a good release. IM was undergoing significant color space changes. You should upgrade if you can. See viewtopic.php?f=4&t=21269

Re: fill black color for an outline

Posted: 2015-09-29T03:51:21-07:00
by Amused23
I upgraded to ImageMagick 6.8.9-9 Q16 x86_64 on my Linux box. It works...thanks a bunch!!