ImageSharp

High-performance image processing for .NET with managed codecs, metadata, color management, and pixel-level control.

ImageSharp lets .NET teams load, inspect, process, and save images with one managed API, whether you are building upload pipelines, thumbnail services, media conversion jobs, photo workflows, asset tooling, or custom imaging systems.

Built for real image workloads

With no native graphics stack or platform interop layer to ship, ImageSharp keeps deployment simple while giving you a modern, fully managed API for image processing in .NET.

It runs anywhere that supports .NET 8+, making it a strong fit for web apps, background services, containers, cloud workloads, desktop tools, and device or edge scenarios.

dotnet add package SixLabors.ImageSharp

Simple pipelines, deep control

Most work in ImageSharp happens through small ordered processing pipelines, so the code you write usually reads in the same order the pixels are transformed.

Common jobs stay easy to follow, while advanced scenarios still have access to explicit encoders, metadata, color-profile handling, pixel buffers, configuration, quantization, and raw memory interop when the pipeline needs more control.

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Webp;
using SixLabors.ImageSharp.Processing;

using Image image = Image.Load("upload.jpg");

image.Mutate(x => x
    .AutoOrient()
    .Resize(new ResizeOptions
    {
        Size = new Size(1600, 1600),
        Mode = ResizeMode.Max
    }));

image.Save("output.webp", new WebpEncoder());

Format-aware conversion

ImageSharp keeps decoded pixels separate from the file format while preserving enough source information for output decisions to stay deliberate.

Detect formats before loading, choose encoders explicitly at public boundaries, preserve or strip metadata intentionally, and bridge animation, indexed color, and frame metadata when the destination format supports it.

  • Read and write JPEG, PNG, WebP, GIF, TIFF, OpenEXR, ICO, CUR, BMP, PBM, QOI, and TGA.
  • Use WebP for lossy, lossless, transparent, or animated output from the same format family.
  • Use TIFF and OpenEXR for archival, print, HDR, high-precision, and imaging-pipeline workflows.
  • Control JPEG quality and progressive output, PNG bit depth and filtering, WebP quality and method, and metadata handling through explicit encoders.
  • Use quantizers, palettes, dithering, and transparent-color handling when indexed output is the right representation.
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Processing;

ImageInfo info = Image.Identify("input.bin");

using Image image = Image.Load("input.bin");

image.Mutate(x => x
    .AutoOrient()
    .Resize(new ResizeOptions
    {
        Size = new Size(1200, 1200),
        Mode = ResizeMode.Max
    }));

// Explicit encoders make output policy visible at the product boundary.
ImageEncoder encoder = info.PixelType.BitsPerPixel > 32
    ? new PngEncoder { BitDepth = PngBitDepth.Bit16 }
    : new JpegEncoder { Quality = 82, Progressive = true };

image.Save("output", encoder);

Production controls

ImageSharp gives production pipelines the controls they need for untrusted source files, predictable output, and high-throughput services.

  • Identify dimensions, frame count, pixel type, metadata, and decoded memory cost before committing to a full decode.
  • Use DecoderOptions to limit frames, skip metadata, decode directly to a target size, and normalize ICC profiles.
  • Preserve, compact, or convert embedded ICC profiles depending on whether the workflow needs original metadata or predictable sRGB pixels.
  • Inspect and preserve EXIF, ICC, IPTC, XMP, CICP, and format-specific metadata when it is part of the output contract.
  • More than 25 pixel formats plus low-level pixel access for custom processing and interop scenarios.
  • Process known pixel formats row by row, or use Vector4 row access when logic should stay pixel-format agnostic.
  • Clone configuration for targeted format registration, allocator, stream, and parallelism policies instead of mutating global defaults.
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;

ImageInfo info = Image.Identify("upload.bin");

if (info.Width > 8000
    || info.Height > 8000
    || info.FrameCount > 1
    || info.GetPixelMemorySize() > 256_000_000)
{
    throw new InvalidOperationException("Unsupported upload.");
}

DecoderOptions options = new()
{
    MaxFrames = 1,
    SkipMetadata = true,
    TargetSize = new Size(1600, 1600),
    ColorProfileHandling = ColorProfileHandling.Convert
};

using Image image = Image.Load(options, "upload.bin");