---
title: "Resize"
canonical: https://www.graphicsmill.com/samples/LargeImages/Transforms/Resize_cs
product: "Graphics Mill"
source: "LargeImages/Transforms/Resize.cs"
---

# Resize

Resizes image using memory-friendly Pipeline API.

## Instruction

Resize an image to a new width and save the result.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Venice.jpg"))
using (var resize = new Resize(1048, 0, ResizeInterpolationMode.Anisotropic9))
using (var writer = ImageWriter.Create("PipelineResize.jpg"))
{
    // In this case we'll get an additional performance benefit by using resize right after the reader.
    // This allows skip decoding of unnecessary image scan-lines.
    Pipeline.Run(reader + resize + writer);
}
```

## Explanation

The code:

- Reads the image.
- Resizes the image to a width of 1048 pixels (height adjusted to maintain aspect ratio).
- Saves the resized image to the specified file.

## Tags

- [Pipeline](<https://www.graphicsmill.com/samples/tags/pipeline_md>): Working with images via the Pipeline API
- [Resize](<https://www.graphicsmill.com/samples/tags/resize_md>): Resizing images

## Input

- [Venice.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_jpg>) (preview)

## Output

- [PipelineResize.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/PipelineResize_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.Resize](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Resize.htm.md>)
- [Aurigma.GraphicsMill.Transforms.ResizeInterpolationMode](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_ResizeInterpolationMode.htm.md>)
