---
title: "Multiple thumbnails"
canonical: https://www.graphicsmill.com/samples/LargeImages/Transforms/GetMultipleThumbnails_cs
product: "Graphics Mill"
source: "LargeImages/Transforms/GetMultipleThumbnails.cs"
---

# Multiple thumbnails

Creates two different-sized images from a single read of the source image. In most cases, reading the image is the bottleneck, so this approach significantly improves performance.

## Instruction

Resize the input image to two different sizes (big and small) and save the results to separate files.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
// reader --->  resizeBig    --->  writerBig
//        \-->  resizeSmall  --->  writerSmall
using (var reader = ImageReader.Create("Venice.jpg"))
using (var resizeBig = new Resize(640, 0, ResizeInterpolationMode.High))
using (var writerBig = ImageWriter.Create("Venice_thumbnail_big.jpg"))
using (var resizeSmall = new Resize(128, 0, ResizeInterpolationMode.High))
using (var writerSmall = ImageWriter.Create("Venice_thumbnail_small.jpg"))
{
    reader.Receivers.Add(resizeBig);
    resizeBig.Receivers.Add(writerBig);

    reader.Receivers.Add(resizeSmall);
    resizeSmall.Receivers.Add(writerSmall);

    Pipeline.Run(reader);
}
```

## Explanation

The code:

- Reads the image "Venice.jpg".
- Resizes the image to 640px wide and saves it as "Venice_thumbnail_big.jpg".
- Resizes the image to 128px wide and saves it as "Venice_thumbnail_small.jpg".

## Tags

- [Branched Pipeline](<https://www.graphicsmill.com/samples/tags/branched-pipeline_md>): Building branched processing pipelines
- [Resize](<https://www.graphicsmill.com/samples/tags/resize_md>): Resizing images
- [Thumbnail](<https://www.graphicsmill.com/samples/tags/thumbnail_md>): Generating thumbnails from images

## Input

- [Venice.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_jpg>) (preview)

## Output

- [Venice\_thumbnail\_big.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_thumbnail_big_jpg>) (preview)
- [Venice\_thumbnail\_small.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_thumbnail_small_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.PipelineElement.Receivers](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PipelineElement_Receivers.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>)
