Click here to Skip to main content
15,896,201 members
Articles / Programming Languages / C#

Converting Bitmap to grayscale

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
17 Jan 2011CPOL 0  
You'll find this tutorial helpful as it shows three different ways to do what you want. The last is my favorite and does its trick by using a ColorMatrix: http://www.switchonthecode.com/tutorials/csharp-tutorial-convert-a-color-image-to-grayscale[^]!Hope this helps you!ModificationCode...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
17 Jan 2011#realJSOP
Ahh, google, why hath thou forsaken everyone but me? Google the phrase "c# convert color image to black and white", and this is one of the 202,000 returned results:public static Bitmap ConvertBlackAndWhite(Bitmap Image){ ColorMatrix TempMatrix = new ColorMatrix(); ...
Please Sign up or sign in to vote.
17 Jan 2011bosco_boom 2 alternatives  
I want to convert an image from bitmap to grayscale, but when I load it in a picturebox...not on a button click event...Like this...I load a bitmap picture and in the picturebox and it appears directly as a grayscale picture...I found some source code on the Internet, but I don't really kmow...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Atos Origin
Germany Germany
While teaching myself BASIC and assembler on a Commodore 64 in the early 80's I got seriously infected by a tough kind of programming virus. The disease turned chronic and has since then been diagonsed as incurable. So I thought I'd put my affliction to good use and studied computer science which, after some trial and error, finally fetched me a degree.


This is some of the ground I've covered over the last 20 years:

  • Database design & programming
  • Application programming
  • Systems programming
  • Web applications
  • Multimedia/HTPC platform development
  • eCommerce software platform
  • Design & development of FAST based search solutions

I will not engage in listing all the languages, frameworks and tools I've worked with. The list would be too long, most probably mainly meaningless and judging by what has been accumulated just over the last 2 years surely incomplete too.

There are of course some languages that deserve to be mentioned as they played a vital role in me becoming what I am now.


  • BASIC
  • Assembler (6502)
  • C
  • Scheme (Lisp dialect)
  • Java
  • C#

The last four years were spent designing and programming FAST based search solutions using FAST Enterprise Search Platform 5.1 & 5.3. Since MS has already announced that FAST ESP will not be further developed and will die by 2017/2018, we are now looking into other technologies like Lucene/Solr, Sinequa and FAST Sharepoint Search.

Comments and Discussions