Developer forum

Forum » CMS - Standard features » Image handler image quality

Image handler image quality

Vincent Gercke Pedersen
Reply

I've noticed that the image quality when using the image handler is worse than when viewing the image directly:

Good quality:

http://rapido-34-full.websrv01.smartpage.dk/Files/Images/noblur.jpg

Worse quality:

http://rapido-34-full.websrv01.smartpage.dk/Admin/Public/GetImage.ashx?Width=220&Crop=5&BackgroundColor=&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/noblur.jpg

I've tried changing the resolution and compression with no luck - has anyone experienced this issue before? On 9.8.9 btw


Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Vincent,

I confirm the bug. I register it to fix asap: 82895

Sorry for inconvenience.

Best regards,
Vladimir

 
Vincent Gercke Pedersen
Reply

Thanks!

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Vincent,

The problem has been solved in Dynamicweb.Imaging 5.3.0
You can either update the Dynamicweb.Imaging package through nuget package manager or wait for the next 9.8 release which should contain Dynamicweb.Imaging 5.3.0

Best regards,
Morten

 
Ambert van Unen
Reply

Hi Morten,

 

9.9 has been released, and we're running on it, but I still see quality being deteriorated.

http://companyfits.cloud.dynamicweb-cms.com/Files/Images/Naamloos-2.jpg

vs

http://companyfits.cloud.dynamicweb-cms.com/Admin/Public/GetImage.ashx?Width=1920&Height=845&Crop=5&BackgroundColor=&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/Naamloos-2.jpg&AlternativeImage=/Images/missing_image.jpg

 

 
Nicolai Pedersen
Reply

Hi Ambert

The image is scaled and compressed. So it will look differently. The point is to make the image smaller so the site gets faster.

By default jpeg are compressed at 75% - by using &Compression=95 you can increase compression and make the image better quality.

You can also change to webp format and use &quality to control it:

The config below makes your image 11kb instead of the original 40kb - 75% smaller in size - and of course that will cause a bit of quality. But you can then increase &quality=85

http://companyfits.cloud.dynamicweb-cms.com/Admin/Public/GetImage.ashx?Width=1920&Height=845&BackgroundColor=&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/Naamloos-2.jpg&AlternativeImage=/Images/missing_image.jpg&format=webp&quality=65

If you need your images in the exact same quality, you should not resize and compress them.

Also you need to flush your image cache (I did that for you on the above solution). It is deep in the release notes :-):

"

  • Change image resizing to use interpolation and antialias
    Settings
    Added interpolation to drawing of images and antialias for rendering to improve the resized result for scaling large images to relatively small versions. Remember to flush image cache after upgrade. Empty cache in Files/cache.net/images."
 
Ambert van Unen
Reply

Hi Nicolai,

 

thanks for the reply, i didnt even know it was a configuration option ;-)

I saw the documentation page about the image handler, but thats only to test images (developer -> image Handler).

 

If this is the correct config: 

/Globalsettings/Modules/Filemanager/AutoResize/JpegCompression 90

Then its already set at 90, i've changed this to 100 and cleared the images cache, but the result seems to remain the same. 

Our client is persistent on uploading images in the correct format, so how could we disable the compression?

 

 
Nicolai Pedersen
Reply

Just do not use getimage at all - use the file path directly - requires a change in the template. Compression=100 is a bad option.

The setting you have found is not used by getimage, but by the filemanagers autoresize feature.

Getimage is documented here: https://doc.dynamicweb.com/documentation-9/platform/platform-tools/getimage-image-handler

 
Ambert van Unen
Reply

Hi Nicolai,

wish I could find a reference to it somewhere on this portal.. ;-)

When checking the Rapido partial 'standardparagraphone, it doesnt use GetImage, but only GetFile. I looked a bit around and found the Components/General/Image.cshtml that the @Render outputs. Here the actual code for the image is being generated. In the code I see a 'settings.DisableImageEnine'.

 

Couldnt I just disable that just as easy, or will other things 'break'.
I actually only want to disable the compression options for the paragraphelements.
Or I should modify each 'paragraph' cshtml to generate the IMG tag manually instead of using @Render?

 

You must be logged in to post in the forum