Repository navigation
Different result between Magick.NET and ImageMagick #2095
|
I'm trying to remove table borders from a
When I try to translate this to C# using Magick.NET, small segments of the table borders remain. I'm not sure what I'm missing. Specifically, the var magick = new MagickFactory().Image.Create(
$"{fileName}.png",
new MagickReadSettings
{
Density = new Density(600, 600, DensityUnit.PixelsPerInch),
// ColorType = ColorType.Grayscale,
}
);
// grayscale image
magick.Grayscale();
// magick.Alpha(AlphaOption.Off);
// magick.WhiteThreshold(new Percentage(75));
magick.Negate();
// effect of morphology is to darken
// magick.Settings.SetDefine("morphology", "compose=darken");
// magick.Settings.SetDefine("morphology:compose", "darken");
magick.Settings.SetDefine(MagickFormat.Png, "morphology:compose", "darken");
// magick.Compose = CompositeOperator.Darken;
// magick.SetArtifact("morphology:compose", "darken");
// identify white (?) areas where our kernel fits
magick.Morphology(
new MorphologySettings
{
// Iterations = 3,
// Channels = Channels.All & ~Channels.Black,
Method = MorphologyMethod.Thinning,
Kernel = Kernel.Rectangle,
KernelArguments = "1x80+0+0<",
// KernelArguments = "Rectangle:1x80+0+0<",
}
);
// undo negation
magick.Negate();
magick.Write($"{fileName}.magick.png");I've experimented with: setting Thanks! |
Replies: 1 comment 3 replies
|
You should use |



You should use
magick.SetArtifact("morphology:compose", "darken");But without your input and output image(s) I cannot help you further.