Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Remove Background

$
0
0
Hi, I've been using this same technique to remove white edge background from a "Target" image, and for some reason, sometimes, the ColorFuzz is not applied.

After a couple of tests, I noticed the issue was intermittent, using same unmodified code. So I put the code in a loop, and indeed concluded its intermittent:
for (int x = 0; x < 20; x++)
{
    using (MagickImage image = new MagickImage(@"C:\Demo\Target.jpeg"))
    {
        image.Alpha(AlphaOption.Set);
        image.ColorFuzz = 20;
        image.FloodFill(MagickColor.Transparent, 0, 0, new MagickColor("#FFF"));
        image.Write(@"C:\Demo\Output\Output_" + x + ".png");
    }
}
Here's the SOURCE image.
And the RESULTS.

As you can see, results #1,3,5,7,9,11 are OK (the ColorFuzz was applied, edges are smooth), but not in the others.

I'm using the latest version "Magick.NET 7.0.0.0006".

Can someone reproduce this issue? Any clue what the problem could be?

Thank you.

Viewing all articles
Browse latest Browse all 3693

Trending Articles