How does DITA handle image optimization for different outputs?

DITA handles image optimization to ensure images are appropriately formatted for diverse output types. It’s vital to adapt images for different media, such as print, web, or mobile devices, to maintain quality and optimize loading times.

DITA optimizes images by way of adaptive image sizing, conditional processing, image file formats, and image compression.

  • Adaptive Image Sizing: DITA allows for defining adaptive image sizing by creating multiple image versions for various outputs. This ensures that the appropriate image size is used depending on the medium. For example, larger, high-resolution images can be used for print and smaller, web-optimized images for online documentation.
  • Conditional Processing: Conditional processing is used to specify which images are included in specific outputs. This way, certain images can be included or excluded based on the output format. For example, high-resolution images may be included in PDF outputs but omitted in HTML versions.
  • Image File Formats: DITA supports various image file formats, and the choice of format can impact optimization. For web outputs, lightweight formats like JPEG or PNG might be preferred, while high-quality print outputs can utilize formats like TIFF or EPS.
  • Image Compression: DITA enables image compression to reduce file sizes while maintaining quality. Compression settings can be adjusted based on the output type. For web outputs, aggressive compression might be suitable, while print outputs require minimal compression to preserve image quality.


A DITA-based technical documentation project for a mobile app is published in web and PDF formats. For the web-based version of the documentation, DITA automatically optimizes images by reducing their resolution and converting them to JPEG format for faster loading on web pages. However, when the same content is published as a downloadable PDF user manual, DITA ensures that the images are high-resolution and minimally compressed to maintain print quality.