Dynamic Media: PNG file size not reduced with quality parameter and preferwebp=true
✨ This content is AI generated and could be inaccurate. Generative AI Terms
This article describes why the quality parameter does not reduce the file size of PNG images delivered as WebP using preferwebp=true in Adobe Experience Manager Dynamic Media, and provides steps to achieve file size reduction.
Description description
Environment
- Adobe Experience Manager Dynamic Media (all versions)
Symptoms
- Images delivered via Dynamic Media URLs with the .png extension and the preferwebp=true parameter remain large in file size, often exceeding 1 MB, even when the quality parameter is set below 85.
- The Content-Type header is image/webp due to preferwebp=true, but the file size remains unchanged.
- When the image is requested with a .webp extension and a quality parameter, the file size is reduced as expected.
- No error messages are shown, but the expected reduction in file size does not occur when using the .png extension with preferwebp=true.
Cause
When a PNG asset is delivered with a .png extension and preferwebp=true, Dynamic Media generates a lossless WebP, so the quality parameter does not affect file size. Using a .webp extension in the URL enables lossy WebP conversion, allowing the quality parameter to reduce file size.
Resolution resolution
Follow the steps below to resolve the issue.
- Update the image delivery URL to use a .webp extension instead of .png.
- Example:
https://example.com/adobe/dynamicmedia/deliver/dm-aid--<asset-id>/book-a-court-branded.webp?width=1600&quality=85 - Verify that the file size is reduced when lowering the quality parameter.
- For assets where file size reduction is required, use the .webp extension in the URL and set the desired quality parameter.
- For JPG source images, the quality parameter works as expected regardless of extension.
- Advise content authors to use the .webp extension in delivery URLs for PNG assets where file size reduction is needed.
- For assets requiring transparency and minimal loss, test different quality values to balance quality and file size.
recommendation-more-help
experience-cloud-kcs-help-kbarticles