Fastest way to convert image to Black and white image
The text of this thread is not in this database — only its details are. Read it on the old site: Fastest way to convert image to Black and white image
The text of this thread is not in this database — only its details are. Read it on the old site: Fastest way to convert image to Black and white image
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Faris Shahin47 reputationPosted Oct 6, 2016, 5:56 AM EDT
You can specify a region and then apply image processing operations on that region without affecting the remaining pixel data of the image. You can find more about specifying regions here:
https://www.leadtools.com/help/leadtools/v19/dh/to/leadtools.topics~leadtools.topics.creatingaregion.html
About converting the pixel data to black and white, you can use LEADTOOLS functions like IntensityDetectCommand Class.
void _viewer_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
_viewer.Image.AddEllipseToRegion(null, new LeadRect(e.X - 30, e.Y - 30, 60, 60), RasterRegionCombineMode.Set);
_intensityDetectCommand.Run(_viewer.Image);
_viewer.Image.MakeRegionEmpty();
}
_viewer.Refresh();
var g = _viewer.CreateGraphics();
g.DrawEllipse(new Pen(Color.Green, 3), new Rectangle(e.X - 30, e.Y - 30, 60, 60));
g.Dispose();
Midhun TpRank #388 · 6.5K reputationPosted Sep 27, 2016, 7:58 AM EDT
Please refer below blogs-
http://www.c-sharpcorner.com/blogs/convert-a-color-image-into-black-and-white-image1
http://notes.ericwillis.com/2009/11/make-an-image-black-and-white-in-csharp/
Piyush Vaishnavswami180 reputationPosted Sep 28, 2016, 1:45 AM EDT
Piyush Vaishnavswami180 reputationPosted Oct 17, 2016, 2:57 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 27, 2016, 7:59 AM EDT