Search code examples
c#imagepngimage-resizingimageresizer

losing quality when resizing with ImageResizer


I'm using the ImageResizer .net library. It works as expected, but one image messes around. I've uploaded the image below. I've already tried some things like format=jpg&quality=100, only width=220, also different sizes, but it always adds this blurry border around the image.

The original image is a png.

This one is the original image: This one here is the original

This one is resized by the ImageResizer:
This one is resized with ImageResizer

And this one is resized with photoshop:
enter image description here

EDIT: If you're running into the same issue. Try to set up the SpeedOrQuality Plugin. I've set it to speed=3 and the image is sharp again.


Solution

  • Vector graphics require different resampling algorithms than photographs.

    ImageResizer V4 includes higher quality image resampling options under the FastScaling plugin.

    For graphics (non-photographic images), I suggest playing with &f.sharpen=0..100, &down.preserve=-5..5, and &down.filter=Robidoux. Make sure &fastscale=true and FastScaling is installed.

    You can certainly find a good configuration for your rasterized vector art and set up a preset for it. FastScaling is capable of much better resampling than Photoshop - on par with Lightroom, in fact.

    Enabling fastscaling alone helps substantially (?width=200&fastscale=true):

    Adding sharpening gives a very clear result: (?width=220&fastscale=true&f.sharpen=100):

    Visibly crisper than Photoshop: