Skip to content

Image resize in dotNet: from JPG to Webp on Windows OS

2-4-2026 - updated 24-6-2026

Introduction

This test is a follow-up for the Image resize in dotNet -JPG to JPG, and answers these follow-up questions:

  • Which packages support JPEG (.jpg), WEBP (.webp) and Portable Network Graphics (.png)?
  • How do these packages perform?
  • Are there differences in quality between the packages?

I used about the same packages from the image resize test.

Boundary conditions

This test:

  • uses 12 pictures of 500kB size each, ~1280 x ~900 px by Bertrand Le Roy plus 3 images of my own ~4000 x ~3000 px and 2-3MB.
  • resizes to thumbnail size (~80px), small (320px) and medium (768px) sizes
  • benchmarks the loading, resizing and saving operations with Benchmark.NET
  • uses .NET 10 (LTS)
  • uses Windows 11 only
  • wants to achieve the highest image quality.
  • saves the original jpeg as 95% quality jpeg format, png and webp in different sizes

Packages summarized

A summary of the packages used in this table:

PackageLicensePublishedVersionDownloads
System.DrawingMIT3-202510.0.52500.0 M
Magick.NetApache 2.03-202614.11.147.1 M
MagicScalerMIT12-20240.15.02.0 M
ImageSharpSix Labors split12-20253.1.12234.7 M
NetVipsMIT1-20263.2.02.4 M
SkiaSharpMIT1-20263.119.2249 M

Read about the resize and implementation details in the Image resize in dotNet -JPG to JPG.
I did not use the imageFlow, because I had trouble with the memory use in the previous implementation already. It is possible to use this package for webp as well, it has encoders.

Format support

The packages claim to support lots of formats. And in fact have no support whatsoever. I only checked for Webp, PNG and Jpg.

PackageJPGPNGWebpRemarks
System.Drawingyy*depends on GDI+ codecs installed and found
ImageSharpyyyGIF and ~3 other formats
Magick.NetyyyGIF and ~100 other formats
MagicScaleryyydepends on WIC codecs installed
NetVipsyyyGIF and multiple other formats
SkiaSharpyyynone of the 9 other supported formats?
ImageFlowyyyno other formats supported

For System.Drawing.Common, Webp has support on windows GDI+ since windows 10- 1089. However, it depends on the codec installed on your system. If no codec can be found, System.Drawing will silently fall back to PNG. I could not get it to work (in the limited time available).

In this test the silent fallback was observed. In order to have a WebP format in test, System.Drawing uses the SkiaSharp package for encoding and saving the image as WebP.

According to a Xamarin blog by Microsoft, SkiaSharp only supports three of the 12 image formats. This test does not check that claim.

Results in numbers

The results of this test in numbers: the time elapsed to produce the pictures, the memory used and the resulting filesize.

Time elapsed

The time elapsed is just an indication, as run on my laptop. So please just focus on the ratio.

Time total

This is not optimized at this moment. For Magick.Net three separate processes are spun up to handle the images. I can imagine this takes time (and memory), making it three times slower. I just spent max 15 minutes per package to do this stuff, I had no more time to spare. Please let me know if you want to improve, or have ideas.

Conclusion

Measuring decreases the performance of the code. All of these packages are fast enough, with Magick.NET being twice slower than the other packages.

Memory usage

The next picture shows allocated memory usage. For your machine this does not matter, as generally speaking the amount of memory on your own machine is sufficient. If you have functions or other an app in the cloud where you pay for memory (or simply crash on memory overload), this is very relevant.

Memory used

For the record: I screwed up System.Drawing by the way I use Skia to save the WebP files. Memory usage of System.Drawing without Skia/WebP is in the order of 500kB. The usage of Skia is about 500kB, so there is nno reason why those combined should be that high. ImageSharp uses a lot of memory. Same as for the image resize blog, I just cut corners, and used the FileHelper shortcut. There are so many options within this package to improve, and I should. If only I could find the right way...

Conclusion

For the largest part memory usage is caused by my mistakes, but it shows that these packages are very sensitive to small changes causing them to misbehave drastically. If you want to use these packages, you need to understand them and their settings

File size

Here the filesize of some 320px-images is shown. It is more about the ratio than the absolute numbers. Keep in mind that this is foremost a reflection of the settings and encoders used.

File size

In general, WebP has the smallest size, closely followed by jpg. The png files are the largest, but there are differences in produced file size between the packages.

  • ImageSharp produces very small WebP files. I cannot explain why, in the next paragraph see if this has effect on the quality.
  • MagicScalar produces very small PNG files, because they lower the bit depth to 24, where other packages are on 32. Keep this in mind when looking at the picture quality later. This might be a configuration that can be changed?
  • System.Drawing and NetVips produce large PNG-files for no apparent reason.

Another way to look at this is: What configuration needs to change in order to produce comparable results?

For specs used, scroll to bottom of article.

Quality

Quality is again a subjective matter. Let's look to some of the pictures produced and see the differences.

ColorSpace management

Most applications use sRGB colorSpace to show a jpg picture. However, there is not such a thing as a default colorSpace. There are several color profiles in-use, and if the developer does not use the right settings to handle this, the picture will look terrible. I changed the settings for most of the libraries to do a conversion to sRGB. This conversion step will slow the process down, but I'd rather have a slow process than faulty colors.

The picture of Wild River has an Adobe RGB profile, which has to be converted to sRGB. Because of the blue, it will show if I have the settings wrong.

This is the original picture, notice the blue. Wild River

The blue in the pictures below should be unchanged (same shade of blue) in the ideal case.

PackageJPGPNGWebp
System.DrawingIMG_2525 System.DrawingIMG_2525 System.DrawingIMG_2525 System.Drawing
ImageSharpIMG_2525-ImageSharpIMG_2525-ImageSharpIMG_2525-ImageSharp
Magick.NetIMG_2525-MagickNETIMG_2525-MagickNETIMG_2525-MagickNET
MagicScalerIMG_2525-MagicScalerIMG_2525-MagicScalerIMG_2525-MagicScaler
NetVipsIMG_2525-NetVipsIMG_2525-NetVipsIMG_2525-NetVips
SkiaSharpIMG_2525-SkiaSharpIMG_2525-SkiaSharpIMG_2525-SkiaSharp

I did not change any settings for this test, so any color mangling comes out of the box. Or because of other reasons?

  • System.Drawing handles colorspace management for blue just fine.
  • ImageSharp has the right blue.
  • Magick.NET handles colorspace management fine, since I fixed the color mangling by keeping the icc-profile in the image.
  • MagicScaler has the right blue, but seems to be a bit brighter or sharper.
  • NetVips has the right blue, look at the code to make sure it keeps the icc-profile in the image.
  • SkiaSharp has some color mangling.

Highlights

When resampling from one ColorSpace to another, the luminescence is not translated correctly. For this Gamma-correction is needed. I did not change these settings for this test. This is extremely noticeable in dark pictures with sharp light features. If the wrong correction is used, the light will be much brighter, and the darks will be darker.

PackageJPGPNGWebp
System.DrawingVuurwerk2020 System.DrawingVuurwerk2020 System.DrawingVuurwerk2020 System.Drawing
ImageSharpVuurwerk2020-ImageSharpVuurwerk2020-ImageSharpVuurwerk2020-ImageSharp
Magick.NetVuurwerk2020-MagickNETVuurwerk2020-MagickNETVuurwerk2020-MagickNET
MagicScalerVuurwerk2020-MagicScalerVuurwerk2020-MagicScalerVuurwerk2020-MagicScaler
NetVipsVuurwerk2020-NetVipsVuurwerk2020-NetVipsVuurwerk2020-NetVips
SkiaSharpVuurwerk2020-SkiaSharpVuurwerk2020-SkiaSharpVuurwerk2020-SkiaSharp
  • System.Drawing:
    • The PNG is fine. The highlights are a tiny bit too low, but the colors are fine.
    • In the JPG, the highlights are a bit too bright, and there is a loss of red in the picture (80% of the pixels in the JPG image match the pixels in the PNG, differences are mainly caused by highlighting).
    • The Skia-saved WebP looks almost exactly like the JPG, but the JPG has more black (artifacts), resulting in an 85% pixel match with the PNG. All due to highlighting.
  • ImageSharp:
    • For the PNG it is just like System.Drawing, the highlights in the PNG are a tiny bit low.
    • The JPG differs only in the artifacts, not the highlighting (86% of the pixels in the JPG image match the pixels in the PNG, differences are only due to artifacts).
    • For the WebP in the 320px size there are huge color mismatches (magenta/blue) and the highlights are too high. This results in a poor 77% pixel match score.
  • Magick.NET:
    • The highlights in the PNG are exactly the same as System.Drawing and ImageSharp. Definitely sharper, but that is another topic.
    • The JPG is a bit too bright (87% of the pixels in the JPG image match the pixels in the PNG, differences are due to highlighting and artifacts).
    • The Webp: Where have the colors gone? The red is way too low. There is only an 82% pixel match with the PNG, due to too much highlighting.
  • MagicScaler: The only package with a consistent behavior across formats. They are all far too white, there is something wrong with the luminescence translation.
    • The PNG is far too white, too much highlighting, the red is gone.
    • The JPG is even more white.
    • The Webp and JPG only differ in artifacts.
  • NetVips:
    • In the PNG, the highlighting is a tiny bit better than Magick.NET, but it lacks a bit of sharpness.
    • In the JPG, the highlighting is as good as the PNG, it scores a brilliant 90% pixel match, only due to artifacts. No differences in highlighting.
    • The Webp has too much white, replacing the red. It still scores 87.5% pixel match, mostly due to highlighting. Not bad for a Webp.
  • SkiaSharp: Just looks dreadful with the artifacts, even the PNG. It handles the highlights just fine, but misses a bit of red.

And in table form:

PackageJPGPNGWebpRemarks
System.Drawing*********
ImageSharp*********Weird color mismatch in Webp
Magick.Net***********
MagicScaler***Extreme highlighting
NetVips**************
SkiaSharp******Weird interlacing artifacts

Only the SkiaSharp and MagicScalar have exactly the same highlighting in the WebP as the JPG formats. Remarkable: the System.Drawing package actually has a better WebP performance. However, a 15% pixel difference due to highlighting only is huge(ly disappointing).

Resampling in High Quality

I configured the packages to output high quality images.

PackageJPGPNGWebp
System.DrawingIMG_2445 System.DrawingIMG_2445 System.DrawingIMG_2445 System.Drawing
ImageSharpIMG_2445-ImageSharpIMG_2445-ImageSharpIMG_2445-ImageSharp
Magick.NetIMG_2445-MagickNETIMG_2445-MagickNETIMG_2445-MagickNET
MagicScalerIMG_2445-MagicScalerIMG_2445-MagicScalerIMG_2445-MagicScaler
NetVipsIMG_2445-NetVipsIMG_2445-NetVipsIMG_2445-NetVips
SkiaSharpIMG_2445-SkiaSharpIMG_2445-SkiaSharpIMG_2445-SkiaSharp
  • System.Drawing: Has the best quality for PNG, and a good JPG and WebP quality as well.
  • ImageSharp: The Webp has weird artifacts, the JPG and PNG look good!
  • Magick.NET: All the different formats are similar in quality.
  • MagicScaler: Crisp and sharp, and consistent over the file formats, the highlights are too white overall.
  • NetVips: The quality is fine and quite consistent.
  • SkiaSharp: blurry and grey-ish blue.

Sharpening

As far as sharpening goes, I did not change the default settings for this test.

PackageJPGPNGWebp
System.DrawingVlinder1 System.DrawingVlinder1 System.DrawingVlinder1 System.Drawing
ImageSharpVlinder1-ImageSharpVlinder1-ImageSharpVlinder1-ImageSharp
Magick.NetVlinder1-MagickNETVlinder1-MagickNETVlinder1-MagickNET
MagicScalerVlinder1-MagicScalerVlinder1-MagicScalerVlinder1-MagicScaler
NetVipsVlinder1-NetVipsVlinder1-NetVipsVlinder1-NetVips
SkiaSharpVlinder1-SkiaSharpVlinder1-SkiaSharpVlinder1-SkiaSharp

None of the packages do anything wrong here, but in the details there are differences.

  • System.Drawing:
    • The sharpness in the PNG is just fine.
    • For the JPG the sharpness is fine as well.
    • The skia-saved WebP is a bit less sharp than the PNG, as is to be expected, but overall it is nice.
  • ImageSharp:
    • Delivers a sharper PNG than System.Drawing, but not as sharp as Magick.NET.
    • The JPG sharpness is a bit of a letdown, actually. The other packages (except SkiaSharp) are sharper.
    • For the WebP it is the same story as for JPG, the sharpness other packages are sharper, in spite of its name.
  • Magick.NET:
    • The PNG is the sharpest of them all.
    • The JPG is very sharp, comes in second after MagicScaler, but has none of the highlighting tricks. So in fact, is the best package for JPG as well.
    • The Webp is a bit less sharp, MagicScaler and NetVips perform better.
  • MagicScaler:
    • The PNG sharpness is good, only Magick.NET is sharper.
    • The JPG is the best, due to the extreme highlights, simulating crisp edges for the eyes.
    • This is the same story for the Webp, the extreme highlights make it look sharper than the other packages.
  • NetVips:
    • In the PNG format, it is fine, like System.Drawing. But the differences between Magick.NET, ImageSharp and MagicScaler are small.
    • In the JPG format, this package does a better job. Only Magick.Net is better, if we take MagicScaler out of the equation.
    • The Webp format is even better, and a clear winner over System.Drawing, ImageSharp and Magick.NET. Only MagicScaler is better, due to the highlighting trick.
  • SkiaSharp: Sorry, I need a trick to improve the sharpness. I have not found it yet.

And in table form:

PackageJPGPNGWebpRemarks
System.Drawing**********
ImageSharp********
Magick.Net*************
MagicScaler**************Sharp due to highlighting trick
NetVips*************
SkiaSharp***Looks blurry

Conclusion regarding picture quality

In the 80 px thumbnail category, the whites from MagicScaler are strong in all the pictures. Skia looks blurry. System.Drawing, ImageSharp and Magick.Net are fine.

The 320px category is where the differences between packages (or their settings) stand out the strongest. I reviewed the picture quality with stars. Five stars meaning best quality, one-star being bad and five stars means great. This very objective manner show the differences between the packages for the different compression formats:

PackageJPGPNGWebpRemarks
System.Drawing**********
ImageSharp********Artifact issues
Magick.Net************
MagicScaler*********Sharp, but highlight issues
NetVips***************
SkiaSharp***Artifact, blurriness, color issues

System.Drawing has great PNG quality, but JPEG and WebP are just fine. There are some edge halo effects in the JPG and blurriness in the Webp.

ImageSharp produces good JPG and PNG, but some WebP images are blurry and have artifacts.

Magick.NET produces a nice PNG quality image, where some JPGs are a bit blurry and have some edge halo, the Webp is even more blurry. Just a tiny bit more, compared to System.Drawing.

MagicScaler produces great pictures in all sizes with regard to sharpness. The low filesize is real magic, as it does not really seem to affect the quality. The downside of this package is the whitening in high contrast scenarios. I'd like to know if there is a fix for that.

NetVips scores fine on all formats, but it is not as sharp as MagicScaler.

SkiaSharp is just blurry overall.

Conclusion

All packages have their drawbacks, or specific use cases. For example, when designing a graphics-application for Android, despite its drawbacks, SkiaSharp is your go-to library. So read the table below with care.
Also, there is the case of your business needs, for example, regarding the license types used. So I invite you to use my benchmark code, change the settings for the use case you have in mind, and choose the right package with the set of requirements you have in mind.

Summarized:

PackageProsCons
System.DrawingPopular (documentation support)Limited file-format support, windows-only
Magick.NetFile-format supportEither good quality and large files OR low quality and small file-size
MagicScalerExtreme highlights and sharpness affect quality
ImageSharpCross-platformLicense for commercial use, high memory usage, small files result in bad webp quality
NetVipsCross-platform
SkiaSharpBlurry images with lots of artifacts, hard to implement

I experienced a lot of problems using System.Drawing, due to limited support for codecs, filetypes and color spaces. Personally I'd steer clear of this package, unless you have a very specific use case for it.
Also. I'd avoid FreeImage, because it is not maintained anymore, and the quality of the images is mediocre. Spending time on tweaking the settings for this package is not worth it, in my opinion.

All the other packages are promising in their own way. I believe most of the downsides can be fixed, like the image quality for SkiaSharp, and the highlighting for MagicScaler.

Resources

Diffchecker

Inspiration:
.NET Core Image Processing

About jpeg:
JPEG definitive guide

Packages:

Webp in System.Drawing
Issues in System.Drawing with Webp on GitHub
Issues in System.Drawing with Webp on StackOverflow
Image formats in System.Drawing

Image formats in ImageSharp

Image formats in Magick.Net

MagicScaler

Image formats in SkiaSharp Xamarin
Image formats in SkiaSharp

Image formats in ImageFlow

Specifications

For the fireworks images:

For PNG-format:

Color-specification in table form:

PackageFormatDepthColor spaceAlphaSubsampling
System.DrawingRGBA8-bitsRGBYes-
ImageSharpRGB8-bitICCNo-
Magick.NetRGB8-bitsRGBNo-
MagicScalerYCbCr8-bitsRGBNoYCbCr4:2:2 (2 1)
NetVipsRGB8-biticcNo-
SkiaSharpRGBA8-bitsRGBYes-

Encoding-specification in table form:

PackageCompressionResFilterInterlace
System.DrawingLossless (Deflate)96 dpiAdaptiveNoninterlaced
ImageSharpLossless (Deflate)300 dpiAdaptiveNoninterlaced
Magick.NetLossless (Deflate)300 dpiAdaptiveNoninterlaced
MagicScalerLossy (DCT)96 dpiDCTBaseline
NetVipsLossless (Deflate)300 dpiAdaptiveNoninterlaced
SkiaSharpLossless (Deflate)-AdaptiveNoninterlaced

For JPG-format:

Color-specification in table form:

PackageFormatDepthColor spaceAlphaSubsampling
System.DrawingYCbCr8-bitsRGBNoYCbCr4:2:0 (2 2)
ImageSharpYCbCr8-bitICC Profile (embedded)NoYCbCr4:4:4 (1 1)
Magick.NetYCbCr8-bitICC Profile (embedded)NoYCbCr4:4:4 (1 1)
MagicScalerYCbCr8-bitsRGBNoYCbCr4:2:0 (2 2)
NetVipsYCbCr8-bitICC Profile (embedded)NoYCbCr4:4:4 (1 1)
SkiaSharpYCbCr8-bitsRGBNoYCbCr4:2:0 (2 2)

Encoding-specification in table form:

PackageCompressionResFilterInterlace
System.DrawingLossy (DCT)96 dpiDCTBaseline
ImageSharpLossy (DCT)300 dpiDCTBaseline
Magick.NetLossy (DCT)300 dpiDCTBaseline
MagicScalerLossy (DCT)-DCTBaseline
NetVipsLossy (DCT)-DCTBaseline
SkiaSharpLossy (DCT)-DCTBaseline