First, I'm trying to remove the backdrop (trim doesn't work as well as this script does).
Part of shell-script:
Code: Select all
var=`convert ./input.jpg -blur 0x4 -threshold 45% -format %@ info:`
convert ./input.jpg -crop $var ./output.jpg
Code: Select all
Magick image = new Magick();
image = new MagickImage(input);
image.Blur(0, 4);
image.Threshold(new ImageMagick.Percentage(45));
image.Write(output);
On a different process, I've been trying to get the blue channel from the image to filter on, but I am unable to figure it out in Magick.NET. image2.Separate(Channels.Blue) isn't giving me what I expected.
Part of shell-script:
Code: Select all
convert ./input.jpg ( +clone -colorspace RGB -channel B -separate +channel -auto-level -threshold 16% +write x.png ) -compose Lighten -composite ./output.jpg
Code: Select all
Magick image = new Magick();
image = new MagickImage(input);
image2 = image.Clone();
image2.ColorSpace = ColorSpace.RGB;
//image2.Separate(Channels.Blue);
image.AutoLevel();
image.Threshold(new ImageMagick.Percentage(16));
//image2.Write("D:\\temp\\image2.png");
image.Composite(image2, CompositeOperator.Lighten);
image.Write(output);