Skip to main content
All CollectionsImplementation guides
How to adjust image quality
How to adjust image quality

How to adjust the compression ratio for your needs in quality and performance

Benjamin Arne avatar
Written by Benjamin Arne
Updated over 8 months ago

By default, TwicPics will automatically choose the best balance for quality and performance for your images. If you need to adjust compression on important images, you can use the quality transformation.

When using TwicPics Native (Vanilla script) you can use the data-twic-tranform attribute to apply the quality transformation on the desired images :

<img data-twic-src="image:<path_to_image>" data-twic-transform="*/quality=85">

Note that the '*/' allows to keep applying transformation generated by the script before the quality transformation.

When using TwicPics API, you can simply apply the quality transformation and chain it with other transformations :

https://<sub>.twic.pics/<path_to_image>?twic=v1/quality=85

i.g : https://<sub>.twic.pics/<path_to_image>?twic=v1/cover=1:1/resize=600/quality=85

⚠️ We recommend not to exceed the value 85 (quality=85) to keep a good performance / quality ratio.

Change quality setup globally for all your images :

You can use default manipulation in you path option to apply the quality transformation globally to all your images delivered through a path :

Note: Changes made through default manipulations might not be immediately visible due to caching. To see the updates on your images, you may need to invalidate the cache. For detailed instructions, please refer to: How to Purge Assets from TwicPics CDN Cache.

Did this answer your question?