[Help Wanted] Fill outside of the circle

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
metal0077
Posts: 4
Joined: 2017-07-04T00:06:24-07:00
Authentication code: 1151

[Help Wanted] Fill outside of the circle

Post by metal0077 »

Hi Guys I want to fill outside of the circle, leaving letters in the middle, and the rest one solid color


The ideal is letters Black and the rest white, its possible?

The image:

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

Re: [Help Wanted] Fill outside of the circle

Post by fmw42 »

What is your IM version and platform? Please always provide that, since syntax differs. Try the following:

Code: Select all

convert input.jpg -fuzz 50% -fill black -opaque black -bordercolor white -border 2 -fill black -draw "color 0,0 floodfill" -alpha off -negate result.png
metal0077
Posts: 4
Joined: 2017-07-04T00:06:24-07:00
Authentication code: 1151

Re: [Help Wanted] Fill outside of the circle

Post by metal0077 »

fmw42 wrote: 2017-07-04T01:03:38-07:00 What is your IM version and platform? Please always provide that, since syntax differs. Try the following:

Code: Select all

convert input.jpg -fuzz 50% -fill black -opaque black -bordercolor white -border 2 -fill black -draw "color 0,0 floodfill" -alpha off -negate result.png
@fmw42 Thanks for the response!

The version:

Code: Select all

$ identify --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-05-26 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
The image is almost OK.
Image

But opening with my OCR software, I got an error

Code: Select all

Warning. Invalid resolution 0 dpi.
So I can't work with that output image yet
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [Help Wanted] Fill outside of the circle

Post by fmw42 »

try simply adding units and density.

Code: Select all

convert input.jpg -fuzz 50% -fill black -opaque black -bordercolor white -border 2 -fill black -draw "color 0,0 floodfill" -alpha off -negate -units pixelsperinch -density 72 result.png
Post Reply