Replies: 4 comments 1 reply
-
I am unable to reproduce your issue with the following code: using (var image = new MagickImage(MagickColors.Red, 1, 1))
{
image.Extent(3, 3, Gravity.Center, MagickColors.White);
TrimHorizontal(image);
Console.WriteLine($"{image.Width}x{image.Height}");
image.Read(MagickColors.Red, 1, 1);
image.Extent(3, 3, Gravity.Center, MagickColors.White);
TrimHorizontal(image);
Console.WriteLine($"{image.Width}x{image.Height}");
} I suspect that the problem is somewhere in your code. Or maybe you are checking an all white image? EDIT: Just noticed that you are not using the column in |
Beta Was this translation helpful? Give feedback.
-
The next version of MagickNET will include a new |
Beta Was this translation helpful? Give feedback.
-
Oh super. Will be using that one
Thanks
Op wo 30 dec. 2020 14:13 schreef Dirk Lemstra <notifications@github.com>:
… The next version of MagickNET will include a new TrimVertical and a new
TrimHorizontal method so you don't need to create one yourself.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#824 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGD53KAF4FSV33XIKDJQNETSXMRQDANCNFSM4VOKAPRA>
.
|
Beta Was this translation helpful? Give feedback.
-
Sounds good, please keep me updated when you release this implementation.
Thanks for the help! (and have a good 2021!)
…On Fri, Jan 1, 2021 at 11:45 AM Dirk Lemstra ***@***.***> wrote:
Decided to call the method TrimEdges instead where you could do something
like this: image.TrimEdges(Gravity.East, Gravity.West);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#824 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGD53KHKZOMVSZGL64IJYRDSXWRT7ANCNFSM4VOKAPRA>
.
|
Beta Was this translation helpful? Give feedback.
-
Prerequisites
Description
I am trying to trim the left and right side of the image, by checking whether the column has only white pixels, if so than crop that column. The following piece of code does not work when calling multiple times for different images. I see that the function works with the first image I am trying to trim, but the second image I am trying to process l am always get the color white back and will cause the image to be trimmed to size 0,0:
}
I have found of a similar bug in this repository (#403), but that one seems to be fixed. Am I doing something wrong or is there a better method of Trimming -horizontal.
Steps to Reproduce
Call the method multiple times in one run (on different images).
System Configuration
Beta Was this translation helpful? Give feedback.
All reactions