---
title: "Adjust Lightness (RGB)"
canonical: https://www.graphicsmill.com/samples/ColorManagement/LabColorSpace/AdjustLightnessRgb_cs
product: "Graphics Mill"
source: "ColorManagement/LabColorSpace/AdjustLightnessRgb.cs"
---

# Adjust Lightness (RGB)

Adjusts brightness modifying all channels of RGB color space.

## Instruction

Adjusts the brightness (lightness) of an image directly in the RGB color space using the Pipeline API.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Chicago.jpg"))
using (var brightness = new Brightness(brightnessAmount))
using (var writer = ImageWriter.Create("AdjustLightnessRgb.jpg"))
{
    Pipeline.Run(reader + brightness + writer);
}
```

## Explanation

The code:

- Reads the "Chicago.jpg" image using `ImageReader`.
- Applies brightness adjustment using the `Brightness` transform with the specified `brightnessAmount`.
- Writes the modified image to "AdjustLightnessRgb.jpg" using `ImageWriter`.

## Tags

- [Channels](<https://www.graphicsmill.com/samples/tags/channels_md>): Reading and combining image channels
- [Pipeline](<https://www.graphicsmill.com/samples/tags/pipeline_md>): Working with images via the Pipeline API
- [Transform](<https://www.graphicsmill.com/samples/tags/transform_md>): Image transforms and effects

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [AdjustLightnessRgb.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/AdjustLightnessRgb_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.ImageReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageReader.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageReader_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageWriter.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageWriter_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Transforms.Brightness](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Brightness.htm.md>)
