0

I'm trimming the extra green borders space around the following image

enter image description here

But after trimming i get small white borders around the image using Image Magick.net

var mfactory = new MagickFactory();
            Bitmap bit;
            using (var image = new MagickImage(mfactory.Image.Create(bmp)))
            {
                // Trimming WhiteSpace
                image.Trim();
                bit = image.ToBitmap();
            }

Image with green borders

enter image description here

techno
  • 6,100
  • 16
  • 86
  • 192
  • Do you get white or green borders? If green, then you need to add some fuzz value to the trim so that it removes antialiased orange-green mix. If white, then that is likely an illusion or an artifact of the viewing software. Please show the exact result. – fmw42 Jun 18 '21 at 16:31
  • @fmw42 The exact result is the second image,you can see a green border. – techno Jun 19 '21 at 04:35
  • Add some fuzz value to make the trim remove a mix of orange and green which is what you see that is left from anti-aliasing when drawing the colors. I do not know your API so cannot tell you the exact command. – fmw42 Jun 19 '21 at 05:35
  • @fmw42 Adding fuzz fixed the issue.Thanks – techno Jun 20 '21 at 08:52

0 Answers0