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

New Post: Crop/Trim White space around an image

$
0
0
The problem is that you are reading a jpeg files as your input. Jpg is lossy so your 'white' pixels are not fully white. You can fix this by setting a ColorFuzz percentage. You might have to tweak the percentage for your situation but your input file converts properly when I used 10%:
using (MagickImage image = new MagickImage(@"D:\image\input.jpg"))
{
  image.ColorFuzz = new Percentage(10);
  image.Trim();
  image.Write(@"D:\out.jpg");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>