← toolkit.bot

EPUB Images: Formats, Compression, Alt Text, and Cover Best Practices

June 11, 2026  ·  7 min read

Images in EPUBs require more care than in print or web. E-ink screens have different colour depths, memory limits vary by device, and accessibility requirements mandate alt text. Here's everything you need to know about handling images correctly in EPUB.

Supported Image Formats

FormatEPUB 2EPUB 3Use case
JPEG / JPGYesYesPhotos, screenshots, complex illustrations
PNGYesYesDiagrams, charts, images requiring transparency
GIFYesYesSimple graphics (avoid — large files)
SVGNoYesVector diagrams, icons, scalable graphics
WebPNoPartialNot recommended — poor reader support

Safe choice: JPEG for photos, PNG for diagrams. Avoid WebP — it's not widely supported by e-readers as of 2026.

Recommended Image Dimensions

E-readers vary in screen resolution. A practical rule:

Compression Before Embedding

Large images slow down EPUB loading and inflate file size. Compress before embedding:

# JPEG: recompress at quality 80 (good quality, ~50% smaller)
convert input.jpg -quality 80 output.jpg

# PNG: lossless compression
optipng -o5 image.png
# or
pngquant --quality 60-80 image.png

# Batch resize all JPEGs to max 1200px wide
mogrify -resize "1200>" -quality 80 *.jpg

Target: body images under 200KB each, total EPUB under 10MB for comfortable loading on older devices.

Alt Text for Accessibility

EPUB Accessibility 1.1 and WCAG 2.2 AA require meaningful alt text on all informative images. The alt attribute on <img> elements is the standard approach:

<!-- Informative image -->
<img src="images/figure1.jpg" alt="Bar chart showing conversion accuracy by document type: 98% for text-only PDFs, 91% for two-column, 87% for scanned."/>

<!-- Decorative image (empty alt, not null) -->
<img src="images/divider.png" alt="" role="presentation"/>

<!-- Complex image with extended description -->
<figure>
  <img src="images/circuit.png" alt="Circuit diagram — see description below" aria-describedby="fig1-desc"/>
  <figcaption id="fig1-desc">Full description: power supply connects to...</figcaption>
</figure>

Cover Image Setup

The cover image requires two declarations in EPUB: the manifest item and the cover-image property.

<!-- In content.opf manifest -->
<item id="cover-image" href="images/cover.jpg"
      media-type="image/jpeg" properties="cover-image"/>

<!-- Cover XHTML page (for the visual cover in the reading flow) -->
<item id="cover" href="cover.xhtml" media-type="application/xhtml+xml"/>

The cover.xhtml page should contain only the image, sized to fill the viewport:

<body style="margin:0;padding:0;">
  <img src="images/cover.jpg" alt="Book cover" style="width:100%;height:100%;object-fit:contain;"/>
</body>

SVG Images in EPUB 3

SVG is supported in EPUB 3 and works well for diagrams and icons that need to scale perfectly. Embed via <img src="diagram.svg"> or include SVG inline in the XHTML. Inline SVG gives full CSS styling control but inflates individual content files. External SVG files referenced via img are cleaner for large diagrams.

Images from PDF Conversion

When converting a PDF to EPUB, images are automatically extracted and embedded. toolkit.bot preserves image quality, adds alt text where possible from PDF metadata, and optimises file sizes. Complex figures (charts, tables rendered as images) include descriptive alt text generated from surrounding context.

Convert your PDF to EPUB free →