Developer forum

Forum » Swift » change quality of webp format

change quality of webp format

Tina Engelsen Pedersen
Reply

Hi 

In your documentation for the image handler, i can see that the default quality for webp images are 50. We want to set a higher quality, which can be done ind the Image.cshtml file in Templates/Designs/Swift/Components.

But if we add it like in the screenshot below, it will just get overwritten if we update to a new swift version. What would the right way be, to get a better quality, without it being overwritten or making a custom template for it?
Could there maybe be implementet a field in website settings, where it will be possible to set the image quality, so it would set the value for both webp (quality) and jpeg (compresson)?


 


Replies

 
Nicolai Pedersen
Reply

Hi Tina

We have had this request a couple of times. I think the change from us will being able to configure the default qualities from configuration in the settings of the backend.

We are not fan of making it a general setting of Swift and we generally do not recommend running with a value of 99 as that could easily triple file sizes and heavily impact your download performance espescially on mobile devices. And that speed will have a potential big impact on conversions and bounces.

Regarding the Swift implementation of image quality, most images would have no significant visual difference running the compression in 50 vs 99 because they are relatively small in width - i.e. product images. But I understand for large cover images that it might be a need to increase to maybe 75 - could be a setting on some of the content items. But 99...

My recommendation to you is to use 75 for XL and XXL and leave M and L as is or maybe 60 - those images are only rendered on mobile devices anyway.

BR Nicolai

 
Tina Engelsen Pedersen
Reply

Hi Nicolai

Thank you for the reccomandations :) The 99 in quality is only shown as an example, and it wouldn't set that high normally.

I hope it'll be a feature in future Dynamicweb verisons, that image quality/compression will be a setting somewhere in the backoffice :) 

So for now, you would recommend that we just change it in this file for swift solutions? 

 
Nicolai Pedersen
Reply

My recommendation is to leave it as is. But client might not agree with that :-)

But if you need less compression for large images, change the XL and XXL to 75 directly in the template for now - and then await our setting for the backend.

BR Nicolai

 

You must be logged in to post in the forum