Control image format delivery in Edge Delivery Services

To control whether Adobe Experience Manager Edge Delivery Services delivers images in WebP or JPEG format, use the format URL parameter and adjust the picture element markup in your block or template. Keep both WebP and JPEG sources unless you must enforce a single format.

Description description

Environment

Adobe Experience Manager (AEM) Edge Delivery Services (all versions)

Symptoms

You may need to control whether images delivered via Edge Delivery Services (EDS) are rendered in WebP or JPEG format. By default, EDS optimizes images for the requesting browser, but certain use cases require enforcing a specific format for compatibility or integration reasons.

  • By default, EDS generates a picture element with multiple sources:

    • WebP for browsers that support it
    • JPEG as a fallback for older browsers
  • The actual format delivered depends on browser support and the image URL parameters or markup configuration.

  • You may need to:

    • Allow both WebP and JPEG (default, recommended)
    • Force JPEG only (for tools or integrations that do not support WebP)
    • Force WebP only (not recommended, as it breaks compatibility with browsers lacking WebP support)

EDS does not generate specific error messages. The issue is about configuration and delivery behavior.

Cause

EDS optimizes image delivery based on browser capabilities and markup configuration. The delivered format is determined by the combination of URL parameters and the structure of the picture element in your templates or blocks.

Resolution resolution

Follow these steps to resolve the issue.

  1. Review the default EDS behavior. EDS automatically generates picture elements with both WebP and JPEG sources. Modern browsers use WebP. Others fall back to JPEG. For more information, see the EDS Media Documentation.

  2. To control the image format, use the format parameter in EDS image URLs:

    1. Use format=webp for WebP.
    2. Use format=jpeg or format=jpg for JPEG.
    3. The delivered format depends on both the URL parameter and the picture markup generated by your block or template.
  3. To allow both WebP and JPEG (recommended default), use a picture element with both WebP and JPEG sources. Browsers supporting WebP use the first source. Others use JPEG.

  4. To force JPEG only, use image URLs with format=jpeg (or format=jpg) and remove WebP source elements from the picture element in your custom block or template. Implement this in your EDS block JavaScript or template logic as needed.

  5. To force WebP only (not recommended), emit only WebP source elements.

    Note: This approach is discouraged as it breaks image display in browsers that do not support WebP.

  6. As a recommended practice, upload JPEG or PNG as source images in AEM Assets and let EDS (and/or Dynamic Media) generate WebP automatically at delivery. Keep both WebP and JPEG variants in your picture elements unless you have a strong technical requirement to enforce JPEG only.

After making these changes, verify that images are delivered in the desired format by inspecting the rendered HTML and image requests in your browser.

recommendation-more-help
experience-cloud-kcs-help-kbarticles