Best practices for using images in easyDITA and ensuring your images are optimized for various outputs.
Images can add value to your content and convey visual information. In DITA, the authoring process is separate from the publishing process, which will impact the way you use images in easyDITA. Use the following best practices to use images successfully.
Choosing the correct file type to save your images as can affect how the image displays and scales. If you’re uploading photos of people, objects, or landscape, save your images as JPGs. If you’re adding screenshots, we recommend saving your images as PNGs. In general, you should use PNGs and SVGs whenever possible because they are the best file formats for different screen sizes and for a variety of publishing outputs like html, xhtml, pdf, etc.
You should avoid manually sizing images as this can cause inconsistencies in publishing. For example, scaling down an image to 300px works when publishing to PDF, but it’s far too small for a webpage.
By default, when publishing using the DITA Open Toolkit, images are not automatically resized. We recommend using custom plugins to consistently restrict the size of images. For example, you can use a custom PDF plugin to restrict the size of all images to the page margins and a custom HTML plugin to restrict the size of all images to the size of the webpage.
Using Images in Topics
You can insert images anywhere they’re valid. If you’re using images in a Task topic to explain a step, we recommend nesting it in another element first. For example, insert an image in the Step Information (< info> ) element: