Recursive AI

Choosing a C# image library

A managed package can simplify deployment, but the files your C# app needs to read and write may point to a library with native codecs.

OneImage is a free, open-source C# image library from Recursive AI for .NET 10, licensed under MIT or Apache-2.0 (NuGet, GitHub). Choose it for common image formats and managed deployment. Compare SkiaSharp if you draw to a canvas or Magick.NET if you need ImageMagick’s format range.

InstallNuGet
dotnet add package RecursiveAI.OneImage --version 1.11.2

Extract photo.jpg from the thumbnail example ZIP into your .NET 10 console project. This program resizes it, writes WebP, and reopens the result to check its dimensions.

Program.csOneImage 1.11.2 · .NET 10
using OneImage;
 
var image = Image.Load("photo.jpg");
image.Resize(width: 320).Save("thumb.webp");
var thumb = Image.Load("thumb.webp");
Console.WriteLine($"Input: {image.Width} x {image.Height}");
Console.WriteLine($"Output: {thumb.Width} x {thumb.Height}");
OutputConsole
Input: 1920 x 1920
Output: 320 x 320

Compare formats, transforms, and deployment

Pick your input and output formats separately. For example, reading an icon, writing a TIFF, and drawing onto a canvas are different jobs. The links below describe the tested OneImage release and the named comparison releases or their official documentation.

LibraryDeployment, formats, and transforms
OneImage 1.11.2

What ships: Managed .NET 10 package; no native libraries.

Formats: Reads and writes PNG, JPEG, WebP, GIF, TIFF, BMP, and ICO. Add packages for SVG input, PDF rendering, or PSD and PSB.

Transforms: Immutable pipelines for resize, crop, and rotation; pixels are computed when requested. Use drawing APIs to compose graphics.

ImageSharp 4.1.4

What ships: Managed .NET 8 package. See the Six Labors Split License v1.0 for that release.

Formats: Built-in encoders and decoders include JPEG, PNG, WebP, GIF, TIFF, BMP, and TGA.

Transforms: Chain resize, crop, and other processors in Mutate, or use Clone to preserve the source.

SkiaSharp 3.119.2

What ships: C# bindings to native Skia. On Linux, choose a matching Linux native-assets package.

Formats: Encodes to a specified format and quality. Common outputs include JPEG, PNG, and WebP; check input support separately.

Transforms: Draw a source rectangle to a destination rectangle to crop and scale within a canvas.

Magick.NET Q8 14.10.0

What ships: AnyCPU and architecture-specific builds use native ImageMagick. The setup guide lists Ghostscript for PDF input and other PostScript-family formats.

Formats: ImageMagick lists read and write support for formats including JPEG, PNG, WebP, and TIFF. Check the format and delegate in your deployed build.

Transforms: Resize to a fixed size or resize animated GIF frames. For 16-bit component precision, evaluate Q16 instead of Q8.

Check the files your app actually handles

  • Photo uploads: test a JPEG with an EXIF rotation tag and a PNG with transparency. Check the orientation of the result and decide which metadata to retain. For public thumbnails, OneImage’s thumbnail preset strips EXIF by default; plain resize is a different operation.
  • Animation and scans: check frame count and timing on a GIF, or page count and page sizes on a TIFF. OneImage’s frame model applies transforms to every frame, but saving as JPEG writes only the first frame.
  • Graphics and documents: distinguish drawing a new graphic from importing an existing one. OneImage can draw paths in the core package; the PDF add-on renders pages as images rather than editing the PDF.
  • Linux containers: smoke-test a real conversion inside the final image on the production architecture. If the code uses System.Drawing.Common, Microsoft removed the Unix support switch in .NET 7; a working Windows development build doesn’t show Linux compatibility.

To try OneImage on your own files, start with the getting-started guide for package setup or the read/write matrix for format variants.