Have you ever wondered, how to generate a lossless transparent webp rendition in Sitecore Content Hub for your DAM images that are in .png or .tif format, then this post is for you.
In a recent project, the client asked me to use webp format across the board for all renditions since it is space saving and gets transmitted via the APIs fast. But Sitecore Content Hub off the bat, when you change the image output format to webp (mime type: image/webp), you'll notice that the transparency is lost for the converted webp image. This is by design.
Don't worry, Sitecore Content Hub uses a conversion tool called imagemagick which takes in conversion parameters that will help preserve the lossless transparent background for the images.
But this cannot be done via the Media Processing UI, you need to do in the backend using the steps below:
- Navigate to the following URL in your Content Hub instance - https://<your CH instance domain>/admin/entitymgmt/entity/1014
- Click the Edit icon on the page
- Navigate to the webp rendition where you want to apply the lossless transparent background
- Add a conversion parameter like this:
- conversionparameters: -define webp:lossless=true
- Click Save
- Regenerate the rendition for your assets (ensure you have all flags turned off in the rendition generation page)
Comments
Post a Comment