IM command:
convert test.png -alpha off \
-alpha set -fuzz 10% -fill none \
-draw "alpha 0,0 floodfill" \
-fill "rgba(255,255,255,1)" +opaque none \
-fill "rgba(0,0,0,1)" -opaque none \
-alpha off testDst.png
My question:
I'm a novice. How can I use IM C API on the above command, thanks.
How to achieve it by IM C API
Re: How to achieve it by IM C API
There are two, MagickCore and MagickWand. We recommend MagickWand.
Re: How to achieve it by IM C API
thanks,What I mean is how to use an api to implement the function of a command and what functions to use. I tried but did not succeed, give some suggestions。
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to achieve it by IM C API
You have to specify which C API you want to use; otherwise, no one can tell you the appropriate commands for that API. Also please identify your IM version and platform.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
Re: How to achieve it by IM C API
System:
linux IM: ImageMagick-7 API: magicwand by c
code:
PixelWand *fillColor = NewPixelWand();
PixelSetColor(fillColor, "rgba(0,0,0,1)");
PixelSetFuzz(fillColor, img.fuzzval);
DrawSetFillColor(drawImage, fillColor);
DrawAlpha(drawImage, 0, 0, FloodfillMethod);
MagickDrawImage(image, drawImage);
I want to get a mask of the image, the above code is applied to the image, get the largest border outside the black, how to reverse the transfer of the rest of the white
linux IM: ImageMagick-7 API: magicwand by c
code:
PixelWand *fillColor = NewPixelWand();
PixelSetColor(fillColor, "rgba(0,0,0,1)");
PixelSetFuzz(fillColor, img.fuzzval);
DrawSetFillColor(drawImage, fillColor);
DrawAlpha(drawImage, 0, 0, FloodfillMethod);
MagickDrawImage(image, drawImage);
I want to get a mask of the image, the above code is applied to the image, get the largest border outside the black, how to reverse the transfer of the rest of the white