---
title: "Adjust Lightness Lab"
canonical: https://www.graphicsmill.com/samples/ColorManagement/LabColorSpace/AdjustLightnessLab_cs
product: "Graphics Mill"
source: "ColorManagement/LabColorSpace/AdjustLightnessLab.cs"
---

# Adjust Lightness Lab

Adjusts brightness modifying lightness channel of Lab color space.

## Instruction

Adjusts the lightness of an image using the LAB color space.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var lChannel = new Bitmap())
using (var aChannel = new Bitmap())
using (var bChannel = new Bitmap())
{
    using (var reader = ImageReader.Create("Chicago.jpg"))
    using (var labConverter = new Aurigma.GraphicsMill.Transforms.ColorConverter(PixelFormat.Format24bppLab))
    using (var splitter = new LabChannelSplitter())
    {
        splitter.L = lChannel;
        splitter.A = aChannel;
        splitter.B = bChannel;

        Pipeline.Run(reader + labConverter + splitter);
    }

    lChannel.ColorAdjustment.Brightness(brightnessAmount);

    using (var combiner = new LabChannelCombiner())
    using (var rgbConverter = new Aurigma.GraphicsMill.Transforms.ColorConverter(PixelFormat.Format24bppRgb))
    using (var writer = ImageWriter.Create("AdjustLightnessLab.jpg"))
    {
        combiner.L = lChannel;
        combiner.A = aChannel;
        combiner.B = bChannel;

        rgbConverter.DestinationProfile = ColorProfile.FromSrgb();

        Pipeline.Run(combiner + rgbConverter + writer);
    }
}
```

## Explanation

The code:

- Reads the "Chicago.jpg" image using `ImageReader`.
- Converts the image to LAB color space (`PixelFormat.Format24bppLab`) with `ColorConverter`.
- Splits the LAB channels (L, A, B) using `LabChannelSplitter` and stores them in separate `Bitmap` objects (`lChannel`, `aChannel`, `bChannel`).
- Adjusts the brightness of the L channel using `ColorAdjustment.Brightness`.
- Combines the modified LAB channels (L, A, B) back together using `LabChannelCombiner`.
- Converts the resulting LAB image back to RGB color space with `ColorConverter`, applying an sRGB color profile.
- Saves the adjusted image as "AdjustLightnessLab.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

- [AdjustLightnessLab.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/AdjustLightnessLab_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorAdjustment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorAdjustment.htm.md>)
- [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.ColorAdjustmentProvider.Brightness(Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_Brightness_1_7a94462e.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_ColorProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile.FromSrgb](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorProfile_FromSrgb.htm.md>)
- [Aurigma.GraphicsMill.LabChannelCombiner](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_LabChannelCombiner.htm.md>)
- [Aurigma.GraphicsMill.LabChannelCombiner.A](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelCombiner_A.htm.md>)
- [Aurigma.GraphicsMill.LabChannelCombiner.B](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelCombiner_B.htm.md>)
- [Aurigma.GraphicsMill.LabChannelCombiner.L](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelCombiner_L.htm.md>)
- [Aurigma.GraphicsMill.LabChannelSplitter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_LabChannelSplitter.htm.md>)
- [Aurigma.GraphicsMill.LabChannelSplitter.A](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelSplitter_A.htm.md>)
- [Aurigma.GraphicsMill.LabChannelSplitter.B](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelSplitter_B.htm.md>)
- [Aurigma.GraphicsMill.LabChannelSplitter.L](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_LabChannelSplitter_L.htm.md>)
- [Aurigma.GraphicsMill.Transforms.ColorConverter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_ColorConverter.htm.md>)
- [Aurigma.GraphicsMill.Transforms.ColorConverter.DestinationProfile](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_ColorConverter_DestinationProfile.htm.md>)
