This short guide describes how to change image brightness using C#. It has details to set the IDE, a list of steps, and a sample code to increase photo brightness using C#. It will guide you to brighten or darken the image as per requirement.
Steps to Increase Brightness of Photo using C#
- Set the IDE to use Aspose.Imaging for .NET to adjust the image brightness
- Use the Image.Load() method to load the source image file as an Image object
- Convert the loaded image to the RasterImage class
- Load all pixel data into memory to improve the performance if not cached earlier
- Adjust the image brightness by setting the desired value
- Configure the output TIFF image characteristics
- Save image as TIFF
These steps describe the process to adjust photo brightness using C#. Load the image file into an Image class object, cast it to RasterImage, cache image data into memory for improved performance, and adjust the brightness by calling the AdjustBrightness() method. Save the resultant image as TIFF using the custom settings in the TiffOptions object.
Code to Increase Brightness of Picture using C#
The above code demonstrates how to develop an image brightness editor using C#. When we set a positive value, it causes brightness in the image. On the other hand, if we set a negative value, it darkens the image according to the provided value.
In this article, we have learned the process of brightening a photo. For creating a multipage TIFF, refer to the article on Create Multipage TIFF using C#.