---
title: "Assemble Pipeline manually"
canonical: https://www.graphicsmill.com/samples/LargeImages/PipelineAPISyntax/BranchedPipeline_cs
product: "Graphics Mill"
source: "LargeImages/PipelineAPISyntax/BranchedPipeline.cs"
---

# Assemble Pipeline manually

In general, the Pipeline API assumes that each element may have several receivers, and each of them receives the same data to process. Here we illustrate how to implement the use case shown in the [Create linear pipeline](<https://www.graphicsmill.com/samples/1f5ac886-a760-4583-9223-cd254f5aa380>) sample using the Pipeline class only for running, while constructing the data flow manually.  
  

You can read more information about pipelines in the [documentation](<https://www.graphicsmill.com/docs/gm/processing-large-images-using-pipelines.htm>).

## Instruction

Resize an image to a width of 320 while maintaining the aspect ratio and save the result. Assemble pipeline manually with .Receivers collections without using Pipeline class.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
// reader --->  resize  --->  writer
using (var reader = ImageReader.Create("Venice.jpg"))
using (var resize = new Resize(320, 0, ResizeInterpolationMode.High))
using (var writer = ImageWriter.Create("Venice_small.jpg"))
{
    // Reader element sends data to resize element
    reader.Receivers.Add(resize);

    // Resize element sends data to writer element
    resize.Receivers.Add(writer);

    // Pass first element
    Pipeline.Run(reader);
}
```

## Explanation

The code:

- Reads the image "Venice.jpg".
- Constructs a simple pipeline manually by wiring .Receivers:
reader → resize → writer.
- Resizes the image to a width of 320, maintaining the original aspect ratio.
- Saves the resized image as "Venice_small.jpg".

## Tags

- [Advanced](<https://www.graphicsmill.com/samples/tags/advanced_md>): Demonstrating advanced usage scenarios
- [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

## Input

- [Venice.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_jpg>) (preview)

## Output

- [Venice\_small.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_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>)
