---
title: "oneimage"
url: https://recursiveai.org/oneimage/
description: "A pure C# image library for .NET, with no dependency beyond .NET itself. One-line thumbnails, crops and conversions on a lazy, tiled engine. PNG, JPEG, WebP, GIF, TIFF, BMP and ICO, with ICC color management. MIT or Apache-2.0."
---

# oneimage

An image library for .NET, written from scratch in C# with no dependency beyond .NET itself. One-line thumbnails, crops and conversions, on a lazy, tiled engine.

```sh
dotnet add package RecursiveAI.OneImage
```

- [oneimage.dev](https://oneimage.dev/)
- [GitHub](https://github.com/recursive-ai-oss/oneimage-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneImage)

## A quick look

Operations only record what to do. Pixels are computed tile by tile when you save, so a 24 MP photo becomes a thumbnail without ever being held at full size.

[Read the guide](https://github.com/recursive-ai-oss/oneimage-csharp/blob/main/docs/guide.md)

*Program.cs · C#*

```
using OneImage;
 
// 400 px thumbnail, upright, no GPS.
Image.Thumbnail("in.jpg", 400)
    .Save("thumb.webp");
 
// Nothing is decoded until Save.
Image.Load("in.jpg")
    .Resize(width: 1200)
    .Rotate(90)
    .Save("out.png");
```

### Lazy, tiled and streaming

Resize, crop and the rest are applied tile by tile on save. JPEGs decode at 1/2, 1/4 or 1/8 scale when that is enough.

### One-liners and a canvas

`Image.Thumbnail` for the common job; an immutable `Image` pipeline and a mutable tiled `Canvas` when you need to edit pixels.

### Color and metadata

ICC v2 and v4 profiles, CMYK to sRGB and resampling in linear light. EXIF orientation is applied for you, and thumbnails strip GPS by default.

### Safe on files you didn’t write

Parsers and decoders are bounds-checked C#, and every decoder is fuzzed. Size limits are on by default and checked from headers before anything large is allocated.

## Faster than ImageSharp on most tasks

Against ImageSharp 3.1.12, oneimage is faster on every benchmark task but two. Watermarking is a tie. CMYK JPEG to sRGB is 1.64× slower, because ImageSharp skips the ICC conversion that oneimage applies.

Native wrappers win some tasks: NetVips is about 3× faster on multi-page TIFF reads and ahead on JPEG encoding and one PNG encode input, and SkiaSharp decodes GIFs faster. A JPEG thumbnail uses about 1 MiB more peak memory than ImageSharp.

[Every result and the method](https://github.com/recursive-ai-oss/oneimage-csharp/blob/main/docs/performance.md)

How many times faster oneimage is than ImageSharp 3.1.12, per task

Wall-clock time, log scale, longer is better. Bars left of 1× are slower; the hatched bar is the one slower task.

1. thumb-jpeg 1.25×
2. thumb-webp 1.39×
3. png-to-webp (natural) 19.1×
4. png-to-webp (photo) 11.3×
5. png-to-webp (screenshot) 2.5×
6. jpeg-decode 1.9×
7. jpeg-encode 1.15×
8. png-decode (natural) 3.4×
9. png-decode (photo) 1.21×
10. png-decode (screenshot) 1.45×
11. png-encode (natural) 4.8×
12. png-encode (photo) 6.1×
13. png-encode (screenshot) 1.9×
14. webp-decode (lossy) 1.8×
15. webp-decode (lossless) 2.7×
16. webp-encode (lossless 2000×1500) 7.5×
17. webp-encode (lossy 2000×1500) 5.8×
18. webp-encode (lossy 400×300) 4.4×
19. gif-decode 2.7×
20. gif-encode 1.26×
21. gif-resize 1.17×
22. tiff-multipage-decode 7.0×
23. tiff-encode 3.0×
24. bmp-decode 1.8×
25. bmp-encode 1.8×
26. upscale-2x 2.0×
27. watermark 1.00× tie
28. cmyk-jpeg-to-srgb 0.61× slower
29. jpeg-decode-rgba 1.8×

Measured with BenchmarkDotNet on one shared workstation. Local measurements, not promises for your hardware.

## The package

- **Formats**: PNG, JPEG, WebP, GIF, TIFF, BMP and ICO. The format of `Save` follows the file extension.
- **ASP.NET Core**: `RecursiveAI.OneImage.Web` resizes images from the URL, with a disk cache, signed URLs and request limits.
- **Migration**: A guide for moving from ImageSharp or System.Drawing.
- **.NET**: .NET 10. NativeAOT and trimming are supported. MIT or Apache-2.0.
- **How it was made**: AI agents designed, wrote and benchmarked it on [Alera](https://recursiveai.org/alera/); Kurtis decided what to build.

## Go further

- [oneimage.dev](https://oneimage.dev/)
- [GitHub](https://github.com/recursive-ai-oss/oneimage-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneImage)
- [Guide](https://github.com/recursive-ai-oss/oneimage-csharp/blob/main/docs/guide.md)
- [How it compares](https://github.com/recursive-ai-oss/oneimage-csharp/blob/main/docs/comparison.md)
- [Migrating](https://github.com/recursive-ai-oss/oneimage-csharp/blob/main/docs/migrating.md)
