---
title: "Median"
canonical: https://www.graphicsmill.com/samples/Transforms/MinimumMaximumMedian/Median_cs
product: "Graphics Mill"
source: "Transforms/MinimumMaximumMedian/Median.cs"
---

# Median

Applies the Median transform to the image.

## Instruction

Apply the "Median" transform to the image using the specified parameter of 3.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.Transforms.Median(3);

    bitmap.Save("Median.jpg");
}
```

## Explanation

The code:

- Reads the image using Bitmap.
- Applies the "Median" transform with a parameter value of 3.
- Saves the transformed image to a new file.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Transform](<https://www.graphicsmill.com/samples/tags/transform_md>): Image transforms and effects

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [Median.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Median_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.Transforms](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_Transforms.htm.md>)
- [Aurigma.GraphicsMill.TransformsProvider.Median(Int32)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_TransformsProvider_Median_1_e1836fc4.htm.md>)
