Create linear pipeline

Pipeline Resize

This sample demonstrates how to create a linear pipeline using simplified syntax. This is the most common use case, when all elements are known and their order is straightforward.

You can read more information about pipelines in the documentation.

Сode Snippet

// reader --->  resize  --->  writer
using (var reader = ImageReader.Create("Venice.jpg"))
using (var resize = new Resize(320, 0, ResizeInterpolationMode.High))
using (var writer = ImageWriter.Create("SimplifiedSyntax.jpg"))
{
    // In most cases pipeline elements are used in a linear order,
    // so you can just chain them and run the pipeline
    (reader + resize + writer).Run();

    // Here is an alternative syntax for better readability
    Pipeline.Run(reader + resize + writer);
}

Input

Venice.jpg

Output

SimplifiedSyntax.jpg

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog