PictureSharp 0.7.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PictureSharp --version 0.7.0
                    
NuGet\Install-Package PictureSharp -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PictureSharp" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PictureSharp" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="PictureSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PictureSharp --version 0.7.0
                    
#r "nuget: PictureSharp, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PictureSharp@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PictureSharp&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=PictureSharp&version=0.7.0
                    
Install as a Cake Tool

PictureSharp

A pure managed image processing library for .NET. No native dependencies.

PictureSharp reads, writes and processes WebP, PNG, JPEG, BMP, GIF, PCX and ICO in 100% C# for .NET 10 and later, with no NuGet dependencies, native libraries or P/Invoke. Output is verified pixel for pixel against libwebp, libjpeg-turbo and Pillow.

Format Read Write
WebP ✔ lossy, lossless, alpha, animation ✔ lossy, lossless, near-lossless, alpha, animation
PNG ✔ all color types and bit depths, APNG ✔ gray, RGB(A), palette, Adam7, APNG
JPEG ✔ baseline, progressive, CMYK/YCCK ✔ baseline, progressive, 4:4:4–4:2:0
BMP ✔ palette, RLE, bit fields, alpha, embedded PNG/JPEG ✔ 1/4/8/24/32-bit
GIF ✔ GIF87a/89a, interlace, transparency, animation ✔ exact or quantized palettes, dithering, animation
ICO ✔ PNG, DIB 1/4/8/24/32-bit ✔ PNG or 32-bit DIB, multiple sizes
PCX ✔ 1–8 bit, 24-bit RGB, 32-bit RGBA ✔ 1/4/8/24/32-bit, RLE
  • Resizing, geometry, color adjustments, filters, compositing and EXIF auto-orientation
  • Levels, gamma, auto contrast, histograms, trimming, alpha masks and W3C blend modes
  • Conversion of ICC and PNG color descriptions to sRGB, linear-light resize and compositing
  • Fast JPEG thumbnails decoded at 1/2, 1/4 or 1/8 scale
  • Frame-by-frame reading and writing of GIF, APNG and WebP animations
  • Typed EXIF and ICC/XMP metadata, editable without recompressing the image
  • Limits for untrusted input and cancellation of all long-running work
  • SIMD on x64 and ARM64, bit-identical to the scalar code
  • Extensible with format plugins and custom processors
  • Optional adapter packages for System.Drawing, SkiaSharp and ASP.NET Core

Quick start

using PictureSharp;

using var image = await Image.LoadAsync("photo.jpg");
image.Mutate(x => x
    .AutoOrient()
    .Resize(1600, 0)                 // 0 keeps the aspect ratio
    .UnsharpMask());
await image.SaveAsync("photo.webp");  // the format comes from the extension

using Image thumbnail = image.Clone(x => x.Thumbnail(256, 256));
thumbnail.Save("thumbnail.png");

Mutate edits the image; Clone returns an edited copy.

Documentation

The public API may still change between 0.x releases.

Building from source

dotnet build -c Release
dotnet test -c Release

License

PictureSharp is licensed under MIT. It includes ports from libwebp, libjpeg-turbo, zlib and Pillow, and is based in part on the work of the Independent JPEG Group; see THIRD-PARTY-NOTICES.txt.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on PictureSharp:

Package Downloads
PictureSharp.Skia

Copies PictureSharp images to and from SkiaSharp SKBitmap, SKImage and SKPixmap with an explicit alpha policy.

PictureSharp.AspNetCore

Returns PictureSharp images from ASP.NET Core endpoints with Accept-based WebP/PNG/JPEG negotiation, and reads uploaded images with size limits and request cancellation.

PictureSharp.Drawing

Copies PictureSharp images to and from System.Drawing.Bitmap (Windows).

PictureSharp.Heif

HEIC/HEIF format plugin for PictureSharp, written entirely in C#. No native dependencies.

PictureSharp.Tiff

TIFF format plugin for PictureSharp, written entirely in C#. No native dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 168 10/28/2026
0.8.5 216 10/26/2026
0.8.4 98 10/26/2026
0.8.3 85 10/26/2026
0.8.2 107 10/25/2026
0.8.1 104 10/23/2026
0.8.0 116 10/23/2026
0.7.13 98 10/22/2026
0.7.12 89 10/22/2026
0.7.10 222 10/22/2026
0.7.9 162 10/21/2026
0.7.8 134 10/21/2026
0.7.7 102 10/20/2026
0.7.6 273 10/18/2026
0.7.5 87 10/18/2026
0.7.4 88 10/18/2026
0.7.3 97 10/18/2026
0.7.2 91 10/17/2026
0.7.1 133 10/17/2026
0.7.0 89 10/17/2026
Loading failed

0.7.0 extends the format plugin SPI: EncoderOptions.Configuration selects the configuration used for saving, plugins can attach HDR gain maps (GainMapMetadata, GainMapImage, ImageDecodeContext.AttachGainMap) and read or rewrite metadata without pixels (IImageFormatMetadataCodec). No breaking API changes; adds end-to-end tests, CLI metadata and streaming resize, and a migration guide from 0.5.0. Notes: https://github.com/art-ix/PictureSharp/blob/v0.7.0/docs/releases/release-0.7.0.md