Table of Contents

Introduction

What is ImageSharp.Drawing?

ImageSharp.Drawing is the high-performance 2D drawing layer for ImageSharp. It adds vector geometry, strokes, fills, text rendering, image composition, clipping, layers, and optional WebGPU-backed rendering while keeping the same cross-platform, managed-code deployment model as ImageSharp.

The core model is deliberately small: geometry describes coverage, brushes and pens describe how pixels are produced, drawing options describe state, and DrawingCanvas records ordered drawing work into a replay timeline. That makes the same drawing code useful for one-off image generation, templated graphics, server-side rendering, retained backend scenes, and GPU-backed output.

Read the articles as a progression. Start with the canvas workflow because replay, state, and lifetime explain the rest of the API. Then learn geometry, brushes, pens, clipping, text, image composition, transforms, and WebGPU as separate pieces that combine into one drawing pipeline.

Start Here

Built against .NET 8, ImageSharp.Drawing can be used in device, cloud, and embedded/IoT scenarios.

License

ImageSharp.Drawing is licensed under the terms of the Six Labors Split License, Version 1.0. See https://sixlabors.com/pricing for commercial licensing details.

Important

Starting with ImageSharp.Drawing 3.0.0, projects that directly depend on ImageSharp.Drawing require a valid Six Labors license at build time. This enforcement applies to direct dependencies only. See License Enforcement Changes and a New Subscription Tier for details.

Installation

ImageSharp.Drawing is installed via NuGet with nightly builds available on Feedz.

PM > Install-Package SixLabors.ImageSharp.Drawing -Version VERSION_NUMBER

Prerelease versions installed via the Visual Studio NuGet Package Manager require the "include prerelease" checkbox to be checked.

How to use the license file

By default, the build searches from each project directory for sixlabors.lic. Place the supplied file in the directory that contains the project file, or in a subdirectory below it. Use the file as supplied; it already contains the complete license string required by the build.

Important

Do not commit sixlabors.lic or a license key to public repositories such as open source projects. Use environment variables or repository secrets instead, and let contributors apply for their own independent keys at https://licensing.sixlabors.com/.

If you want to keep the file somewhere else, including a repository root that sits above the project directory, set SixLaborsLicenseFile in your project file or a shared props file:

<PropertyGroup>
  <SixLaborsLicenseFile>path/to/sixlabors.lic</SixLaborsLicenseFile>
</PropertyGroup>

If you do not want to store the license on disk, pass the license string directly from an environment variable or secret store. When extracting the value from sixlabors.lic, use the full file contents, not only the Key field:

<PropertyGroup>
  <SixLaborsLicenseKey>$(SIXLABORS_LICENSE_KEY)</SixLaborsLicenseKey>
</PropertyGroup>

You can also pass the key to common .NET CLI commands.

PowerShell:

dotnet build -p:SixLaborsLicenseKey="$env:SIXLABORS_LICENSE_KEY"
dotnet publish -p:SixLaborsLicenseKey="$env:SIXLABORS_LICENSE_KEY"

Bash and other shells that expand environment variables with $NAME:

dotnet build -p:SixLaborsLicenseKey="$SIXLABORS_LICENSE_KEY"
dotnet publish -p:SixLaborsLicenseKey="$SIXLABORS_LICENSE_KEY"

Build as normal after the file or property is configured. If the license is missing or invalid, the build fails with a clear error. You do not need to reference the licensing package directly; it is carried by Six Labors libraries.

How to Use These Docs

  • Start with the canvas model, because replay, state, and lifetime explain the rest of the API.
  • Use paths and brushes pages when geometry and styling decisions are still unclear.
  • Use text and image-processing pages when drawing must combine rich text, source images, clipping, and effects.
  • Use WebGPU pages only when the output target genuinely benefits from GPU-backed rendering.