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 is resized by the ImageResizer:
And this one is resized with photoshop:
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.
2
Answers
Each time you save a jpeg, you loose quality (the image is reencoded).
I would recommend using the same quality as the original image was save against, it should give the best results.
Using a higher quality is not recommended as it will artificially try to improve quality, mistaking approximations done by previous encoding for details, resulting in things like the blurry border.
Aside that, usually, one should not use a quality over 95 for jpeg encoding.
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: