This project has moved and is read-only. For the latest updates, please go here.

please help

Apr 10, 2016 at 9:54 AM
  1. help to translate into Magick.NET C# code:
convert test.bmp -fuzz 20% -fill black -opaque "#c62122" -threshold 1% convert.bmp
  1. How to convert image betwen System.Drawing.Bitmap and ImageMagick.MagickImage ?
Sorry for my english.
Apr 15, 2016 at 12:00 PM
Your command translates to this:
using (MagickImage image = new MagickImage("test.bmp"))
  image.ColorFuzz = new Percentage(20); // -fuzz 20%
  image.Opaque(new MagickColor("#c62122"), MagickColors.Black); // -fill black -opaque "#c62122"
  image.Threshold(new Percentage(1)); // -threshold 1%
Most of the command line options are methods/properties of the MagickImage class. And below is an example that demonstrates how you can convert a MagickImage to and from a bitmap.
using (Bitmap bitmap = new Bitmap("input.bmp"))
  using (MagickImage image = new MagickImage(bitmap))
    return image.ToBitmap();