Knowledge Base > Color Adjustment
PhotoController 2.1
ContentsIndexHome
PreviousUpNext
Bitmap Color Adjustment in .NET with PhotoController

In PhotoController, you can call ColorAdjust method to do some simple color adjustment. This method accepts a Color value or a System.Drawing.Imaging.ColorMatrix value. There is an article that explains how ColorMatrix works in CodeProject, which is well written and the article uses VB.NET. I won't spend too much time to rewrite anything about it, but I want to show the following figures to demonstrates the results by using PhotoController.

Source Image
Source Image
Color Adjustment Yellow

Yellow Color Adjustment

Controller.ColorAdjust ( Color.Yellow )

Green Color Adjustment

Green Color Adjustment

Controller.ColorAdjust ( Color.Green )

Besides the ColorAdjust method, PhotoControler also offers many Filters to do the color adjustment, including GrayScaleFilter, GreyFilter, InvertColorFilter, ContrastFilter, SepiaFilter, BlackWhiteFilter, GammaFilter, HSLAdjustFilter, and so on.

GrayScale
GrayScale Result Image by using GrayScaleFilter
Sepia Image

Sepia Image

SepiaFilter.Level = 21

Sepia is a configurable filter, 21 is the default value, which will normally achieve the best effect. But since different image might have different result, you could do some slight adjustments to obtain your best result.

BlackWhite Image

Black and White Image

This is the image processed by BlackWhiteFilter, with a Threshold is 162.

By default, BlackWhiteFilter.Threshold is 128. But still, some images might have different color collection, to obtain a better result, you might need a smaller or a larger threshold value.

Invert Image

Invert Image

This image is processed by using InvertColorFilter. If you need a more configurable effect, you might need SolarizeFilter, which simulates Solarization effect. The default value is zero, which will give you exactly the same result as InvertColorFilter; but in SolarizeFilter, you could adjust the level of solarization.

 

Gamma Filter

Gamma Adjustment

GammaFilter.BlueGamma = 1.2

You can adjust RedGamma, GreenGamma, and BlueGamma in GammaFilter

Send comments about this topic.
Copyright (c) 2006-2007 @ ImageComponent.NET All rights reserved.