In this post, we'll explore Meziantou.Framework.Imaging. This package, under MIT license, allows you to read, write, process, and draw images in .NET, with code written entirely in C#.
In one sentence: more than 20 image formats, including the AVIF and HEIC photos of phones and JPEG XL, more than 60 processing operations, drawing, text in any script, and color management, in a single package with no native dependency. And it's fast! The benchmarks at the end of this post compare it with ImageSharp and SkiaSharp.
Image processing in .NET usually means a compromise. SkiaSharp and Magick.NET wrap native libraries, whose binaries must match the operating system and the processor of every machine you deploy to. ImageSharp is fully managed, but it is not free for every project, and it doesn't read AVIF or HEIC files at the time of writing. Meziantou.Framework.Imaging, under MIT license, implements every codec in C#, including the AV1 and HEVC codecs behind AVIF and HEIC. The same package runs on Windows, Linux, and macOS, on x64 and ARM64, and in trimmed and Native AOT applications.
This post is an overview of the package, with a few samples and the images they produce. Every image of this post was drawn by these samples.
#What it can do
- Read and write more than 20 formats: PNG and APNG, JPEG, GIF, WebP, AVIF, HEIC, JPEG XL, JPEG 2000, TIFF, BMP, TGA, QOI, Netpbm, ICO and CUR, PSD, OpenEXR, Radiance HDR, DDS and KTX 2.0 textures, DPX… The format is detected from the content of the file, not from its extension.
- Animations: GIF, APNG, WebP, AVIF, HEIC, and JPEG XL animations load as full frames with their exact durations, and every operation applies to all the frames. Streaming readers and writers process long animations one frame at a time.
- Processing: resize, crop to the content, rotate, correct a perspective, blur, sharpen, detect edges, adjust the colors, the levels, and the curves, reduce to a palette, remove scratches, resize without distorting the content (seam carving), add a watermark, and more.
- Drawing: shapes, paths, SVG path data, gradients, patterns, shadows, masks, and layers, with antialiasing.
- Text: TrueType, OpenType, WOFF, and WOFF2 fonts, paragraphs, right-to-left and vertical text, and the complex scripts, such as Arabic and Hindi, with fallback fonts.
- Color and metadata: EXIF, XMP, and ICC profiles are kept, the orientation of photos is applied on request, and colors are converted between ICC profiles, CMYK included.
- Untrusted files: limits on the memory, the size, and the number of frames protect your application from hostile files.
- Same input, same pixels: decoding, processing, and drawing give the same pixels on every platform, which makes the output testable.
#Installation
Shell
dotnet package add Meziantou.Framework.Imaging
The images, loading, and processing are in the Meziantou.Framework.Imaging namespace, the encoders in Meziantou.Framework.Imaging.Formats, the canvas in Meziantou.Framework.Imaging.Drawing, and the text in Meziantou.Framework.Imaging.Typography.
#Converting and resizing
The most common task takes three lines. Image.Load detects the format from the content of the file, Resize keeps the aspect ratio by default, and the encoder selects the output format:
C#
using var image = Image.Load("photo.heic"); // The photo of a phone
image.Resize(new ResizeOptions(1200, 1200)); // Fits in 1200x1200 and keeps the aspect ratio
image.Save("photo.webp", new WebPEncoder { Compression = WebPCompression.Lossy, Quality = 80 });
The package is strict: it never loses something silently. Saving an image with transparent pixels as JPEG, a 16-bit image to an 8-bit format, or an animation to a format that stores one picture throws an UnsupportedImageFeatureException that says what to set, instead of writing a different image.
#Drawing
The sample image of this post is drawn with the canvas: a linear gradient for the sky, a radial gradient for the sun, and two paths for the mountains:
C#
using var image = new Image<Rgba32>(640, 360);
var sky = new LinearGradientBrush(new PointD(0, 0), new PointD(0, 260), [
new GradientStop(0, Rgba32.ParseHex("#1E3C72")),
new GradientStop(0.6, Rgba32.ParseHex("#E96443")),
new GradientStop(1, Rgba32.ParseHex("#FFD194"))]);
var sun = new RadialGradientBrush(new PointD(440, 200), 70, [
new GradientStop(0, Rgba32.ParseHex("#FFF6D5")),
new GradientStop(0.5, Rgba32.ParseHex("#FFC65C")),
new GradientStop(1, new Rgba32(255, 198, 92, 0))]);
var mountains = new VectorPathBuilder()
.MoveTo(new PointD(0, 250)).LineTo(new PointD(120, 150)).LineTo(new PointD(220, 220))
.LineTo(new PointD(340, 120)).LineTo(new PointD(470, 230)).LineTo(new PointD(560, 170))
.LineTo(new PointD(640, 220)).LineTo(new PointD(640, 360)).LineTo(new PointD(0, 360))
.Close().Build();
image.Draw(canvas =>
{
canvas.Fill(sky);
canvas.FillCircle(sun, new PointD(440, 200), 70);
canvas.Fill(Rgba32.ParseHex("#5B3A6E"), mountains);
// The closer mountains are another path, with a darker color
});
image.Save("landscape.png");

landscape.png
#Processing
Each operation is a method that changes the image in place, for all its frames:
C#
using var image = Image.Load("landscape.png");
image.GaussianBlur(4);
// Some other operations:
// image.Grayscale();
// image.Pixelate(16);
// image.OilPaint(4, 16);
// image.DetectEdges(EdgeDetector.Sobel);
// image.Quantize(new QuantizeOptions { MaxColors = 8 });
// image.Rotate(15);
image.Save("blurred.png");
Here is the result of these operations on the landscape:
The same image with 8 processing operations
#Text in any script
Text is drawn from font files, which you load once and share. A FontStack draws each character with the first font that has it, and the text engine orders the right-to-left text and shapes the complex scripts. Here is a card for social media, with an image resized and drawn on it:
C#
var font = Font.Load("NotoSans-Regular.ttf");
var fonts = new FontStack(font, Font.Load("NotoNaskhArabic-Regular.ttf"), Font.Load("NotoSansDevanagari-Regular.ttf"));
var title = TextLayout.Create("Image processing in .NET", new TextStyle(fonts, 72));
var subtitle = TextLayout.Create("Hello, مرحبا, नमस्ते", new TextStyle(fonts, 44));
var badgeText = TextLayout.Create("Meziantou.Framework.Imaging", font, size: 32);
var background = new LinearGradientBrush(new PointD(0, 0), new PointD(1200, 630), [
new GradientStop(0, Rgba32.ParseHex("#0F2027")),
new GradientStop(1, Rgba32.ParseHex("#2C5364"))]);
using var landscape = Image.Load<Rgba32>("landscape.png");
landscape.Resize(new ResizeOptions(400, 225));
using var card = new Image<Rgba32>(1200, 630);
card.Draw(canvas =>
{
canvas.FillRectangle(background, new RectangleD(0, 0, 1200, 630));
canvas.FillText(Colors.White, title, new PointD(80, 120));
canvas.FillText(Rgba32.ParseHex("#FFD194"), subtitle, new PointD(80, 240));
var badge = new RectangleD(80, 420, 520, 80);
canvas.FillRoundedRectangle(new Rgba32(255, 255, 255, 40), badge, 16);
canvas.FillText(Colors.White, badgeText, badgeText.GetOrigin(badge, TextHorizontalAnchor.Center, TextVerticalAnchor.Center, TextBounds.Ink));
canvas.DrawImage(landscape.Frames[0], new PointD(720, 330), 1);
});
card.Save("card.png");

card.png: the Arabic word is joined and written from right to left, and the Hindi word uses a conjunct
The output doesn't depend on the fonts installed on the machine: you get the same pixels on a developer machine and in a container.
The newer formats compress much better than JPEG. Here is the landscape saved in several formats, with the size of the file and its SSIMULACRA 2 score, a metric of the visual quality computed by ImageSimilarity.ComputeSsimulacra2 (100 for identical pixels, about 90 when the difference is not visible):
| Format | Size | SSIMULACRA 2 |
|---|
| PNG | 14,795 bytes | 100 |
| JPEG, quality 85 | 12,974 bytes | 84.3 |
| WebP, lossy, quality 80 | 3,728 bytes | 79.4 |
| AVIF, lossy, quality 60 | 2,964 bytes | 86.4 |
| HEIC, lossy, quality 60 | 4,063 bytes | 89.8 |
| JPEG XL, lossy (default quality, 75) | 4,748 bytes | 87.5 |
| JPEG XL, lossless | 10,115 bytes | 100 |
This image has large areas of smooth color, which every format compresses well, so the sizes of a photo are larger and the differences between formats vary. JPEG XL has another feature: it recompresses an existing JPEG file without decoding its pixels, and gives back the original file byte for byte.
The encoders are also strict about color. OpenEXR and Radiance HDR store linear light: saving this sRGB image as .exr throws an exception that asks you to convert the samples first, instead of writing a file with the wrong colors.
#Untrusted files
A small file can describe a huge image, or thousands of frames. When you process files uploaded by users, set the limits of the configuration: the library checks them before allocating the pixels, and throws an ImageResourceLimitException:
C#
var configuration = new ImageConfiguration
{
Limits = new ImageResourceLimits { MaxLiveAllocationBytes = 64 * 1024 * 1024 },
};
using var image = Image.Load("upload.jpg", new ImageDecodeOptions { Configuration = configuration });
The decoders are also tested against malformed files: a corrupted file throws an InvalidImageContentException, an unknown format an UnknownImageFormatException, and a feature the codec doesn't support an UnsupportedImageFeatureException, so you can tell the user what is wrong.
A managed library doesn't have to be slow. I compared Meziantou.Framework.Imaging 1.2.20 with SixLabors.ImageSharp 4.1.4 and SkiaSharp 4.158.0, the latest versions when writing this post, on .NET 10, with BenchmarkDotNet. The machines are an AMD Ryzen 9 9900X running Windows 11 (x64) and an Apple M5 Pro running macOS (ARM64), and the images have 1920x1080 and 4000x3000 pixels (FullHd and Photo12MP). Meziantou.Framework.Imaging is the baseline: a ratio above 1 means that the other library is slower.
Each operation runs on one thread (Parallel is False), and with MaxDegreeOfParallelism set to the number of logical processors (True). One thread is the default of Meziantou.Framework.Imaging, and all the processors is the default of ImageSharp. SkiaSharp has no such option, so the tables only show it once, with Parallel set to False: compare the True rows with it too. The ratios are computed against Meziantou.Framework.Imaging with the same value of Parallel. The resize isn't the same work in every library, for Resize and for Thumbnail: SkiaSharp uses bilinear filtering with mipmaps, which reads fewer pixels than the Catmull-Rom filter of the other libraries. It is cheaper, but the result is slightly softer and has more aliasing. DecodeJpegToSrgb decodes a JPEG file tagged with a Display P3 profile and converts its pixels to sRGB. Allocated only counts managed memory, so it doesn't include the native memory of SkiaSharp.| Method | Size | Parallel | Mean | Error | StdDev | Ratio | Allocated |
|---|
| Meziantou_DecodePng | FullHd | False | 9.466 ms | 0.128 ms | 0.120 ms | 1.00 | 4694 B |
| ImageSharp_DecodePng | FullHd | False | 11.290 ms | 0.048 ms | 0.040 ms | 1.19 | 30285 B |
| Skia_DecodePng | FullHd | False | 11.114 ms | 0.127 ms | 0.119 ms | 1.17 | 296 B |
| Meziantou_DecodePng | FullHd | True | 9.539 ms | 0.131 ms | 0.122 ms | 1.00 | 4694 B |
| ImageSharp_DecodePng | FullHd | True | 11.344 ms | 0.159 ms | 0.149 ms | 1.19 | 30285 B |
| Meziantou_DecodePng | Photo12MP | False | 58.256 ms | 0.810 ms | 0.718 ms | 1.00 | 5326 B |
| ImageSharp_DecodePng | Photo12MP | False | 66.692 ms | 0.994 ms | 0.930 ms | 1.14 | 157069 B |
| Skia_DecodePng | Photo12MP | False | 65.413 ms | 0.840 ms | 0.786 ms | 1.12 | 296 B |
| Meziantou_DecodePng | Photo12MP | True | 58.712 ms | 0.820 ms | 0.767 ms | 1.00 | 5326 B |
| ImageSharp_DecodePng | Photo12MP | True | 67.504 ms | 0.757 ms | 0.671 ms | 1.15 | 157069 B |
| Meziantou_DecodeJpeg | FullHd | False | 2.728 ms | 0.001 ms | 0.001 ms | 1.00 | 32023 B |
| ImageSharp_DecodeJpeg | FullHd | False | 3.926 ms | 0.013 ms | 0.010 ms | 1.44 | 16695 B |
| Skia_DecodeJpeg | FullHd | False | 6.990 ms | 0.037 ms | 0.031 ms | 2.56 | 296 B |
| Meziantou_DecodeJpeg | FullHd | True | 2.433 ms | 0.018 ms | 0.018 ms | 1.00 | 150805 B |
| ImageSharp_DecodeJpeg | FullHd | True | 3.906 ms | 0.036 ms | 0.034 ms | 1.61 | 16600 B |
| Meziantou_DecodeJpeg | Photo12MP | False | 15.078 ms | 0.074 ms | 0.069 ms | 1.00 | 32498 B |
| ImageSharp_DecodeJpeg | Photo12MP | False | 23.072 ms | 0.112 ms | 0.093 ms | 1.53 | 17328 B |
| Skia_DecodeJpeg | Photo12MP | False | 39.396 ms | 0.269 ms | 0.225 ms | 2.61 | 296 B |
| Meziantou_DecodeJpeg | Photo12MP | True | 12.942 ms | 0.067 ms | 0.056 ms | 1.00 | 12518738 B |
| ImageSharp_DecodeJpeg | Photo12MP | True | 23.277 ms | 0.423 ms | 0.396 ms | 1.80 | 17328 B |
| Meziantou_DecodeJpegToSrgb | FullHd | False | 17.394 ms | 0.032 ms | 0.027 ms | 1.00 | 114894 B |
| ImageSharp_DecodeJpegToSrgb | FullHd | False | 190.170 ms | 2.196 ms | 2.054 ms | 10.93 | 2233963 B |
| Skia_DecodeJpegToSrgb | FullHd | False | 11.746 ms | 0.223 ms | 0.219 ms | 0.68 | 368 B |
| Meziantou_DecodeJpegToSrgb | FullHd | True | 5.332 ms | 0.030 ms | 0.028 ms | 1.00 | 240448 B |
| ImageSharp_DecodeJpegToSrgb | FullHd | True | 181.180 ms | 2.369 ms | 2.216 ms | 33.98 | 2233963 B |
| Meziantou_DecodeJpegToSrgb | Photo12MP | False | 77.527 ms | 0.727 ms | 0.607 ms | 1.00 | 6931776 B |
| ImageSharp_DecodeJpegToSrgb | Photo12MP | False | 1,110.239 ms | 15.685 ms | 14.672 ms | 14.32 | 6169848 B |
| Skia_DecodeJpegToSrgb | Photo12MP | False | 66.451 ms | 1.281 ms | 1.316 ms | 0.86 | 368 B |
| Meziantou_DecodeJpegToSrgb | Photo12MP | True | 20.977 ms | 0.105 ms | 0.098 ms | 1.00 | 40416844 B |
| ImageSharp_DecodeJpegToSrgb | Photo12MP | True | 1,029.942 ms | 20.435 ms | 19.115 ms | 49.10 | 6169848 B |
| Meziantou_Resize | FullHd | False | 1.621 ms | 0.014 ms | 0.013 ms | 1.00 | 4065 B |
| ImageSharp_Resize | FullHd | False | 1.981 ms | 0.016 ms | 0.015 ms | 1.22 | 14808 B |
| Skia_Resize | FullHd | False | 1.594 ms | 0.031 ms | 0.029 ms | 0.98 | 304 B |
| Meziantou_Resize | FullHd | True | 1.594 ms | 0.016 ms | 0.015 ms | 1.00 | 4065 B |
| ImageSharp_Resize | FullHd | True | 2.052 ms | 0.016 ms | 0.015 ms | 1.29 | 14808 B |
| Meziantou_Resize | Photo12MP | False | 8.578 ms | 0.055 ms | 0.051 ms | 1.00 | 4520 B |
| ImageSharp_Resize | Photo12MP | False | 11.244 ms | 0.060 ms | 0.056 ms | 1.31 | 17432 B |
| Skia_Resize | Photo12MP | False | 5.739 ms | 0.114 ms | 0.178 ms | 0.67 | 304 B |
| Meziantou_Resize | Photo12MP | True | 2.662 ms | 0.019 ms | 0.016 ms | 1.00 | 8759 B |
| ImageSharp_Resize | Photo12MP | True | 11.150 ms | 0.080 ms | 0.075 ms | 4.19 | 17437 B |
| Meziantou_EncodePng | FullHd | False | 37.344 ms | 0.376 ms | 0.314 ms | 1.00 | 4135684 B |
| ImageSharp_EncodePng | FullHd | False | 161.737 ms | 0.439 ms | 0.342 ms | 4.33 | 9969424 B |
| Skia_EncodePng | FullHd | False | 90.456 ms | 0.816 ms | 0.763 ms | 2.42 | 4222288 B |
| Meziantou_EncodePng | FullHd | True | 37.820 ms | 0.528 ms | 0.494 ms | 1.00 | 4135684 B |
| ImageSharp_EncodePng | FullHd | True | 162.876 ms | 1.909 ms | 1.786 ms | 4.31 | 9969424 B |
| Meziantou_EncodePng | Photo12MP | False | 222.641 ms | 2.062 ms | 1.722 ms | 1.00 | 33521464 B |
| ImageSharp_EncodePng | Photo12MP | False | 969.936 ms | 5.184 ms | 4.849 ms | 4.36 | 76863088 B |
| Skia_EncodePng | Photo12MP | False | 556.104 ms | 8.969 ms | 8.390 ms | 2.50 | 33829784 B |
| Meziantou_EncodePng | Photo12MP | True | 222.937 ms | 2.674 ms | 2.501 ms | 1.00 | 33521464 B |
| ImageSharp_EncodePng | Photo12MP | True | 974.782 ms | 8.157 ms | 7.630 ms | 4.37 | 76863088 B |
| Meziantou_EncodeJpeg | FullHd | False | 2.853 ms | 0.011 ms | 0.009 ms | 1.00 | 1002849 B |
| ImageSharp_EncodeJpeg | FullHd | False | 6.356 ms | 0.088 ms | 0.082 ms | 2.23 | 1064240 B |
| Skia_EncodeJpeg | FullHd | False | 17.158 ms | 0.293 ms | 0.274 ms | 6.01 | 523776 B |
| Meziantou_EncodeJpeg | FullHd | True | 1.805 ms | 0.014 ms | 0.013 ms | 1.00 | 1334661 B |
| ImageSharp_EncodeJpeg | FullHd | True | 6.375 ms | 0.061 ms | 0.057 ms | 3.53 | 1064240 B |
| Meziantou_EncodeJpeg | Photo12MP | False | 16.659 ms | 0.091 ms | 0.085 ms | 1.00 | 4157160 B |
| ImageSharp_EncodeJpeg | Photo12MP | False | 36.616 ms | 0.676 ms | 0.633 ms | 2.20 | 4210016 B |
| Skia_EncodeJpeg | Photo12MP | False | 98.004 ms | 0.857 ms | 0.802 ms | 5.88 | 4193864 B |
| Meziantou_EncodeJpeg | Photo12MP | True | 9.677 ms | 0.057 ms | 0.053 ms | 1.00 | 23224086 B |
| ImageSharp_EncodeJpeg | Photo12MP | True | 39.261 ms | 0.065 ms | 0.061 ms | 4.06 | 4210016 B |
| Meziantou_Thumbnail | FullHd | False | 2.810 ms | 0.034 ms | 0.031 ms | 1.00 | 99973 B |
| ImageSharp_Thumbnail | FullHd | False | 4.730 ms | 0.047 ms | 0.044 ms | 1.68 | 91560 B |
| Skia_Thumbnail | FullHd | False | 3.894 ms | 0.077 ms | 0.102 ms | 1.39 | 44088 B |
| Meziantou_Thumbnail | FullHd | True | 2.521 ms | 0.033 ms | 0.029 ms | 1.00 | 129434 B |
| ImageSharp_Thumbnail | FullHd | True | 4.754 ms | 0.060 ms | 0.056 ms | 1.89 | 91560 B |
| Meziantou_Thumbnail | Photo12MP | False | 12.088 ms | 0.199 ms | 0.186 ms | 1.00 | 109658 B |
| ImageSharp_Thumbnail | Photo12MP | False | 15.479 ms | 0.146 ms | 0.137 ms | 1.28 | 95168 B |
| Skia_Thumbnail | Photo12MP | False | 11.857 ms | 0.127 ms | 0.112 ms | 0.98 | 46368 B |
| Meziantou_Thumbnail | Photo12MP | True | 11.162 ms | 0.166 ms | 0.155 ms | 1.00 | 169675 B |
| ImageSharp_Thumbnail | Photo12MP | True | 15.453 ms | 0.212 ms | 0.198 ms | 1.38 | 95168 B |
AMD Ryzen 9 9900X, Windows 11, .NET 10.0.15, x64| Method | Size | Parallel | Mean | Error | StdDev | Ratio | Allocated |
|---|
| Meziantou_DecodePng | FullHd | False | 9.136 ms | 0.029 ms | 0.027 ms | 1.00 | 4710 B |
| ImageSharp_DecodePng | FullHd | False | 13.371 ms | 0.062 ms | 0.058 ms | 1.46 | 30285 B |
| Skia_DecodePng | FullHd | False | 10.149 ms | 0.072 ms | 0.068 ms | 1.11 | 296 B |
| Meziantou_DecodePng | FullHd | True | 9.111 ms | 0.019 ms | 0.018 ms | 1.00 | 4710 B |
| ImageSharp_DecodePng | FullHd | True | 12.967 ms | 0.020 ms | 0.018 ms | 1.42 | 30285 B |
| Meziantou_DecodePng | Photo12MP | False | 67.210 ms | 0.141 ms | 0.125 ms | 1.00 | 5342 B |
| ImageSharp_DecodePng | Photo12MP | False | 81.978 ms | 0.210 ms | 0.186 ms | 1.22 | 157102 B |
| Skia_DecodePng | Photo12MP | False | 60.331 ms | 0.229 ms | 0.214 ms | 0.90 | 296 B |
| Meziantou_DecodePng | Photo12MP | True | 67.107 ms | 0.270 ms | 0.253 ms | 1.00 | 5342 B |
| ImageSharp_DecodePng | Photo12MP | True | 82.038 ms | 0.306 ms | 0.287 ms | 1.22 | 157102 B |
| Meziantou_DecodeJpeg | FullHd | False | 3.417 ms | 0.016 ms | 0.014 ms | 1.00 | 30431 B |
| ImageSharp_DecodeJpeg | FullHd | False | 6.049 ms | 0.051 ms | 0.047 ms | 1.77 | 16600 B |
| Skia_DecodeJpeg | FullHd | False | 2.529 ms | 0.014 ms | 0.013 ms | 0.74 | 296 B |
| Meziantou_DecodeJpeg | FullHd | True | 2.227 ms | 0.044 ms | 0.064 ms | 1.00 | 75869 B |
| ImageSharp_DecodeJpeg | FullHd | True | 6.315 ms | 0.126 ms | 0.243 ms | 2.84 | 16600 B |
| Meziantou_DecodeJpeg | Photo12MP | False | 19.778 ms | 0.309 ms | 0.258 ms | 1.00 | 30932 B |
| ImageSharp_DecodeJpeg | Photo12MP | False | 36.181 ms | 0.558 ms | 0.522 ms | 1.83 | 17328 B |
| Skia_DecodeJpeg | Photo12MP | False | 15.131 ms | 0.071 ms | 0.059 ms | 0.77 | 300 B |
| Meziantou_DecodeJpeg | Photo12MP | True | 12.061 ms | 0.204 ms | 0.181 ms | 1.00 | 96921 B |
| ImageSharp_DecodeJpeg | Photo12MP | True | 35.608 ms | 0.240 ms | 0.224 ms | 2.95 | 17328 B |
| Meziantou_DecodeJpegToSrgb | FullHd | False | 14.643 ms | 0.223 ms | 0.209 ms | 1.00 | 113274 B |
| ImageSharp_DecodeJpegToSrgb | FullHd | False | 106.720 ms | 0.464 ms | 0.434 ms | 7.29 | 2234002 B |
| Skia_DecodeJpegToSrgb | FullHd | False | 15.914 ms | 0.306 ms | 0.286 ms | 1.09 | 368 B |
| Meziantou_DecodeJpegToSrgb | FullHd | True | 4.496 ms | 0.090 ms | 0.177 ms | 1.00 | 163639 B |
| ImageSharp_DecodeJpegToSrgb | FullHd | True | 109.453 ms | 1.598 ms | 1.495 ms | 24.35 | 2234002 B |
| Meziantou_DecodeJpegToSrgb | Photo12MP | False | 74.916 ms | 1.064 ms | 0.943 ms | 1.00 | 6930184 B |
| ImageSharp_DecodeJpegToSrgb | Photo12MP | False | 621.450 ms | 2.397 ms | 2.242 ms | 8.30 | 6169848 B |
| Skia_DecodeJpegToSrgb | Photo12MP | False | 93.585 ms | 0.312 ms | 0.292 ms | 1.25 | 368 B |
| Meziantou_DecodeJpegToSrgb | Photo12MP | True | 18.040 ms | 0.107 ms | 0.089 ms | 1.00 | 23785937 B |
| ImageSharp_DecodeJpegToSrgb | Photo12MP | True | 631.561 ms | 8.985 ms | 7.965 ms | 35.01 | 6169848 B |
| Meziantou_Resize | FullHd | False | 3.753 ms | 0.005 ms | 0.004 ms | 1.00 | 4082 B |
| ImageSharp_Resize | FullHd | False | 3.526 ms | 0.014 ms | 0.013 ms | 0.94 | 40408 B |
| Skia_Resize | FullHd | False | 0.673 ms | 0.001 ms | 0.001 ms | 0.18 | 304 B |
| Meziantou_Resize | FullHd | True | 3.656 ms | 0.073 ms | 0.102 ms | 1.00 | 4082 B |
| ImageSharp_Resize | FullHd | True | 3.563 ms | 0.043 ms | 0.036 ms | 0.97 | 40408 B |
| Meziantou_Resize | Photo12MP | False | 17.446 ms | 0.187 ms | 0.175 ms | 1.00 | 4545 B |
| ImageSharp_Resize | Photo12MP | False | 17.581 ms | 0.012 ms | 0.011 ms | 1.01 | 51672 B |
| Skia_Resize | Photo12MP | False | 2.039 ms | 0.014 ms | 0.012 ms | 0.12 | 304 B |
| Meziantou_Resize | Photo12MP | True | 4.014 ms | 0.029 ms | 0.027 ms | 1.00 | 9025 B |
| ImageSharp_Resize | Photo12MP | True | 17.618 ms | 0.017 ms | 0.015 ms | 4.39 | 51672 B |
| Meziantou_EncodePng | FullHd | False | 28.204 ms | 0.050 ms | 0.047 ms | 1.00 | 4135672 B |
| ImageSharp_EncodePng | FullHd | False | 126.095 ms | 0.352 ms | 0.312 ms | 4.47 | 9969424 B |
| Skia_EncodePng | FullHd | False | 79.456 ms | 1.566 ms | 1.609 ms | 2.82 | 4222288 B |
| Meziantou_EncodePng | FullHd | True | 28.052 ms | 0.041 ms | 0.037 ms | 1.00 | 4135672 B |
| ImageSharp_EncodePng | FullHd | True | 121.912 ms | 0.385 ms | 0.360 ms | 4.35 | 9969424 B |
| Meziantou_EncodePng | Photo12MP | False | 163.263 ms | 0.311 ms | 0.275 ms | 1.00 | 33521430 B |
| ImageSharp_EncodePng | Photo12MP | False | 726.809 ms | 0.897 ms | 0.839 ms | 4.45 | 76863088 B |
| Skia_EncodePng | Photo12MP | False | 459.596 ms | 0.829 ms | 0.647 ms | 2.82 | 33829784 B |
| Meziantou_EncodePng | Photo12MP | True | 164.234 ms | 0.457 ms | 0.405 ms | 1.00 | 33521430 B |
| ImageSharp_EncodePng | Photo12MP | True | 743.553 ms | 14.514 ms | 19.376 ms | 4.53 | 76863088 B |
| Meziantou_EncodeJpeg | FullHd | False | 4.796 ms | 0.007 ms | 0.006 ms | 1.00 | 1002848 B |
| ImageSharp_EncodeJpeg | FullHd | False | 8.780 ms | 0.022 ms | 0.019 ms | 1.83 | 1064240 B |
| Skia_EncodeJpeg | FullHd | False | 6.272 ms | 0.019 ms | 0.017 ms | 1.31 | 523776 B |
| Meziantou_EncodeJpeg | FullHd | True | 1.907 ms | 0.003 ms | 0.003 ms | 1.00 | 1028726 B |
| ImageSharp_EncodeJpeg | FullHd | True | 8.778 ms | 0.012 ms | 0.010 ms | 4.60 | 1064240 B |
| Meziantou_EncodeJpeg | Photo12MP | False | 27.481 ms | 0.021 ms | 0.018 ms | 1.00 | 4157168 B |
| ImageSharp_EncodeJpeg | Photo12MP | False | 51.900 ms | 0.091 ms | 0.085 ms | 1.89 | 4210016 B |
| Skia_EncodeJpeg | Photo12MP | False | 37.114 ms | 0.071 ms | 0.067 ms | 1.35 | 4193864 B |
| Meziantou_EncodeJpeg | Photo12MP | True | 9.626 ms | 0.017 ms | 0.015 ms | 1.00 | 15712690 B |
| ImageSharp_EncodeJpeg | Photo12MP | True | 51.293 ms | 0.088 ms | 0.078 ms | 5.33 | 4210016 B |
| Meziantou_Thumbnail | FullHd | False | 2.210 ms | 0.004 ms | 0.004 ms | 1.00 | 98442 B |
| ImageSharp_Thumbnail | FullHd | False | 5.616 ms | 0.064 ms | 0.053 ms | 2.54 | 117160 B |
| Skia_Thumbnail | FullHd | False | 2.322 ms | 0.007 ms | 0.006 ms | 1.05 | 44096 B |
| Meziantou_Thumbnail | FullHd | True | 2.442 ms | 0.047 ms | 0.044 ms | 1.00 | 130884 B |
| ImageSharp_Thumbnail | FullHd | True | 5.593 ms | 0.028 ms | 0.024 ms | 2.29 | 117160 B |
| Meziantou_Thumbnail | Photo12MP | False | 9.327 ms | 0.019 ms | 0.017 ms | 1.00 | 108074 B |
| ImageSharp_Thumbnail | Photo12MP | False | 19.553 ms | 0.019 ms | 0.016 ms | 2.10 | 129408 B |
| Skia_Thumbnail | Photo12MP | False | 9.613 ms | 0.012 ms | 0.010 ms | 1.03 | 46368 B |
| Meziantou_Thumbnail | Photo12MP | True | 9.614 ms | 0.028 ms | 0.023 ms | 1.00 | 172635 B |
| ImageSharp_Thumbnail | Photo12MP | True | 19.363 ms | 0.032 ms | 0.029 ms | 2.01 | 129408 B |
Apple M5 Pro, macOS, .NET 10.0.14, ARM64
You can download the benchmark project to run it on your machine.
#Additional resources
This post is part of the series 'Exploring Meziantou.Framework'. Be sure to check out the rest of the blog posts of the series!Show the 18 posts of the series
Do you have a question or a suggestion about this post? Contact me!