-
Hi 👋🏻 First of all, thank you for your awesome library! To display it on an ePaper display, I need it as a black/white image. Furthermore, I only need a single I did the b/w conversion like this: using var image = new MagickImage();
await image.ReadAsync(screenshotFile);
if (blackAndWhite)
{
image.Alpha(AlphaOption.Off);
image.Threshold(new Percentage(95));
}
return image.ToByteArray(); That looks okay, but not as crisp like in image processing software like GIMP. Now I have two questions:
Thank you! Versions:
|
Beta Was this translation helpful? Give feedback.
Answered by
dlemstra
Jun 26, 2023
Replies: 1 comment 3 replies
-
You are pretty close. Below is an example of what you could do to export the pixels instead: using var image = new MagickImage();
image.Read(screenshotFile);
if (blackAndWhite)
{
// Maybe gets you a better result ?
image.Alpha(AlphaOption.Off);
image.Threshold(new Percentage(95));
// This will make your image monochrome.
image.ColorType = ColorType.Bilevel;
}
// This will export the pixels of the image.
using var pixels = image.GetPixelsUnsafe();
pixels.ToByteArray("R"); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
mu88
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are pretty close. Below is an example of what you could do to export the pixels instead: