Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
GlennIM
Posts: 23 Joined: 2018-07-23T05:22:12+00:00
Authentication code: 1152
Post
by GlennIM » 2019-06-06T05:41:02+00:00
I'm trying to remove "white space" from images using the Trim() function but doesn't seem to work. Here is my code and the sourceImgTrimmed. What is wrong?
Code: Select all
string sourceImg = @"D:\\large_1683_EK08BK_Open_WEB.jpg";
string sourceImgTrimmed = @"D:\\large_1683_EK08BK_Open_Trimmed.jpg";
using (MagickImage image = new MagickImage(sourceImg))
{
image.Trim();
image.RePage();
image.Write(sourceImgTrimmed);
}
snibgo
Posts: 12159 Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-06-06T10:10:36+00:00
Many of your "white" pixels are not exactly white. Use a fuzz factor such as 5%.
GlennIM
Posts: 23 Joined: 2018-07-23T05:22:12+00:00
Authentication code: 1152
Post
by GlennIM » 2019-06-06T15:01:56+00:00
I added this line to the code below and it worked! Is that the correct code to use?
Code: Select all
image.ColorFuzz = new Percentage(5);