---
title: "Resize Image And Clipping Path (Memory Friendly)"
canonical: https://www.graphicsmill.com/samples/Metadata/ClippingPath/ResizeImageAndClippingPathMemoryFriendly_cs
product: "Graphics Mill"
source: "Metadata/ClippingPath/ResizeImageAndClippingPathMemoryFriendly.cs"
---

# Resize Image And Clipping Path (Memory Friendly)

Resizes image and clipping path using memory-friendly Pipeline API.

## Instruction

Resize an image by reducing its dimensions to half while preserving the clipping paths in the Adobe resources, and save it to a new file.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
using (var reader = new JpegReader("Apple.jpg"))
using (var writer = new JpegWriter("ResizeImageAndClippingPathMemoryFriendly.jpg"))
using (var resize = new Resize(reader.Width / 2, reader.Height / 2))
{
    writer.AdobeResources = reader.AdobeResources;

    Pipeline.Run(reader + resize + writer);
}
```

## Explanation

The code:

- Reads the input image.
- Resizes the image to half of its original width and height.
- The clipping paths in the Adobe resources are preserved during the process.
- Saves the resized image with the specified output filename.

## Tags

- [Adobe Resources](<https://www.graphicsmill.com/samples/tags/adobe-resources_md>): Working with Adobe image resource blocks
- [Pipeline](<https://www.graphicsmill.com/samples/tags/pipeline_md>): Working with images via the Pipeline API
- [Read](<https://www.graphicsmill.com/samples/tags/read_md>): Reading images with codecs
- [Resize](<https://www.graphicsmill.com/samples/tags/resize_md>): Resizing images
- [Write](<https://www.graphicsmill.com/samples/tags/write_md>): Writing images with codecs

## Input

- [Apple.jpg](<https://www.graphicsmill.com/samples/Metadata/compiled/Debug/Apple_jpg>) (preview)

## Output

- [ResizeImageAndClippingPathMemoryFriendly.jpg](<https://www.graphicsmill.com/samples/Metadata/compiled/Debug/ResizeImageAndClippingPathMemoryFriendly_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.ImageReader.AdobeResources](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ImageReader_AdobeResources.htm.md>)
- [Aurigma.GraphicsMill.Codecs.JpegReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.JpegWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegWriter.htm.md>)
- [Aurigma.GraphicsMill.Codecs.JpegWriter.AdobeResources](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_JpegWriter_AdobeResources.htm.md>)
- [Aurigma.GraphicsMill.Transforms.Resize](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Resize.htm.md>)
