Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to lighten picture in C# without actually iterating through all picture's pixels?

I'm having problem with lightening picture. I know I could do this by increasing/decreasing pixel's values, however it's not what I'm looking for. I've been told that there's a way that do not require to iterate through all pixels and that it is much faster. How to do this? Thanks.

like image 207
Patryk Avatar asked May 13 '13 12:05

Patryk


1 Answers

You use the ColorMatrix class in System.Drawing code to apply color transformations in a highly optimized way. Effects like brightness and contrast changes are directly supported. This web page shows you what the matrix should look like.

like image 55
Hans Passant Avatar answered Oct 17 '22 00:10

Hans Passant