# Images in MarkItDown: keep them, extract them, or describe them

> Why MarkItDown 0.1.9 replaces pictures with data:image…, how to keep them, save them as files, or get AI descriptions, and why a JPEG alone can come out empty.

Source: https://markitdown.dev/formats/images/ · Updated 2026-11-15·Upstream source ↗

By default MarkItDown keeps a *placeholder* for each picture, not the picture. What you can get instead depends on which of three things you need: the image data, the images as files, or a description in words.

> **Short answer**
>
> -   **Keep the image data:** the `--keep-data-uris` option.
> 
> ```bash
> markitdown report.docx --keep-data-uris -o report.md
> ```
> 
> -   **Save images as files:** not built in; a tested script is [below](#extract).
> -   **Describe images in words:** configure an LLM client ([setup and cost](https://markitdown.dev/llm/)); results from two local models are [below](#describe).
> -   **Text inside the images** (screenshots, scans): [OCR](https://markitdown.dev/ocr/).

Tested with markitdown 0.1.9 · Python 3.13 · markitdown\[all\] 0.1.9 · ExifTool 12.76 · Linux lab; descriptions by two local vision models on a CPU-only runner (T10) · 2026-11-15 · evidence: [office-features.csv](https://markitdown.dev/data/office-features.csv), [llm-providers.csv](https://markitdown.dev/data/llm-providers.csv), [images-features.jsonl](https://markitdown.dev/evidence/T07/images-features.jsonl), [img-I10-exiftool.md](https://markitdown.dev/evidence/T07/outputs/img-I10-exiftool.md)

## What happens to pictures by default

Pictures by source, one test file each, markitdown 0.1.9 (the keep\_data\_uris effect is in the note)
| Source | Result | What came out | Note |
| --- | --- | --- | --- |
| DOCX picture without alt text | changed | `Before↵↵![](data:image/png;base64...)↵↵After` | Placeholder with the data cut off after base64. With keep\_data\_uris: 44 to 11246 characters. |
| DOCX picture with alt text | changed | `![A bar chart of quarterly revenue](data:image/png;base64...)` | Alt text kept; data cut off. With keep\_data\_uris: 61 to 11263 characters. |
| PPTX pictures | changed | `<!-- Slide number: 1 -->↵# Pictures↵↵![A bar chart of quarterly revenue](Picture2.jpg)↵↵![chart.png](Picture3.jpg)` | An image reference to a file name that is never written; the alt text or the original file name is the label. With keep\_data\_uris: 114 to 22542 characters. |
| XLSX picture | lost | `## Sheet↵| Quarter | Revenue |↵| --- | --- |↵| Q1 | 10 |↵| Q2 | 14 |↵| Q3 | 9 |` | Pictures in workbooks are not output at all. |
| PDF picture | lost | `Text above a picture↵↵Text below the picture↵↵` | Pictures in PDFs are not output. |
| HTML inline data-URI image | changed | `# Page↵↵Text↵↵![A chart](data:image/png;base64...)![Remote](https://example.org/remote.png)` | The inline image is truncated like Office images; the remote image keeps its URL and is not fetched. With keep\_data\_uris: 91 to 11293 characters. |
| EPUB image | changed | `**Title:** Image book↵**Language:** en↵**Identifier:** x↵↵# Chapter↵↵Text before.↵↵![A chart](chart.png)` | See the excerpt for how the image reference looks. |
| PNG file on its own | changed | `ImageSize: 640x360↵` | With ExifTool installed: the size only. Without ExifTool the output is empty (row I10). |
| JPEG file on its own | changed | `ImageSize: 640x360↵Artist: MarkItDown pilot↵` | With ExifTool installed: the metadata fields it finds, no description of the picture. |
| JPEG without and with ExifTool | changed | `without: (empty) | with: ImageSize: 640x360↵Artist: MarkItDown pilot↵` | ExifTool 12.76; without ExifTool the output is empty. |
| GIF file | lost | `UnsupportedFormatException: Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.` | No converter. |
| BMP file | lost | `UnsupportedFormatException: Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.` | No converter. |
| TIFF file | lost | `UnsupportedFormatException: Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.` | No converter. |
| WEBP file | lost | `UnsupportedFormatException: Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.` | No converter. |
| SVG file | changed | `<svg xmlns="http://www.w3.org/2000/svg" width="40" height="20"><rect width="40" height="20" fill="red"/></svg>` | Echoed as XML source. |

*Pictures by source, one test file each, markitdown 0.1.9 (the keep_data_uris effect is in the note) Source: Test T07 · Linux lab · 2026-11-15 · office-features.csv · Download CSV*

In short: Word, HTML and EPUB give an image reference, with the data cut off for Word and HTML; PowerPoint gives a reference to a file that is never written; Excel and PDF give nothing.

## Why you see `data:image/png;base64...`

The ellipsis is deliberate truncation: the picture was in the file and was cut to save tokens. A Word file with one picture came out as 44 characters by default and 11,246 characters with the data kept:

````markdown
Before↵↵![](data:image/png;base64...)↵↵After
````

*img-I01.md · 52 bytes*

## Keep images in the output

The command-line flag and the Python keyword are the same option; the output of a Word file then starts like this (the flag is shown above):

```console
$ markitdown docx-images-no-alt.docx --keep-data-uris
[exit 0] 1.10s  stdin=none
--- stdout (34508 bytes, first 2000)
# Images

![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFoCAIAAABIUN0GAAAgmUlEQVR4nO3dd1yV5f/H8QsPIgii4gAHigriwJl7pObELe7ZMCvN3KY2rF+WWZm5MsscmFsEBPeepaLIcCGomOYELARB4cDvj1PnSxykcw7IR+H1fPjwIfd9n/v+3Nd13+fNPbVI+OueAgAAeauQdAEAABREBDAAAAIIYAAABBDAAAAIIIABABBAAAMAIIAABgBAAAEMAIAAAhgAAAEEMAAAAghgAAAEEMAAAAgggAEAEEAAAwAggAAGAEAAAQwAgAACGAAAAQQwAAACCGAAAAQQwAAACCCAAQAQQAADACCAAAYAQAABDACAgIIewDGxsQsWLuntNajBSy2qunk0aNSy34BhPyz9+eHDh9KlCRg89DVnF/dV3mukC0FmQ4ePrFSlxsVLEdKF5DLxTa6zZy9nF/eAwO1SBWSSnp7e2bOXW416t27flq4Fz1yBDuANG31av9xx7rwFZ4LPxsTGpqSkxMTEnDwVNHvONy1f7rBr917pAv/Hq99gZxf39Rs2SxcCAfv2Hzxy9Fj3bp41a7hL14JckM3ubGFhMWXy+OTk5Nlfzs37wpDHCm4AL/t55dRpHyYkJlarWmXBd9+cOXXsauS5k78dmjP7s3LlnB48+PPt0eN8/QKky0RBp9VqZ30+x8LCYvKkcdK1IC907PBKvXp1tgZsCwkNk64Fz1YBDeAzwWe/+PIbpVSbl1vt3rnVq0/PsmXLFC5cuHy5ckOHDNy3O7BOndppaWnTP5h59Vq0dLEo0PbuO3D1WnTTJo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Wrfjl2/LdtW30mTZm2fcdu/ZRngs++PvKdpUsWeHbp
--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

We confirmed the option on Word, PowerPoint and HTML. PDFs and workbooks have no pictures in the output to keep. Whether a Markdown viewer renders a `data:` image is a property of the viewer; we did not test any.

## Save images as files with relative links

There is no built-in option in 0.1.9 (the command line has no such flag: [CLI reference](https://markitdown.dev/cli/)).

### Our tested route

Convert with the data kept, decode each image, write it into an `images` folder and rewrite the link. This ran on a Word file, a PowerPoint file and an HTML page; it does nothing for EPUB, which already gives a file name, and we did not run it on the whole corpus:

```python
import base64, re
from pathlib import Path
from markitdown import MarkItDown

def extract_images(source: str, out_dir: str = "images") -> str:
    """Convert with the image data kept, write every data: image to out_dir and point the Markdown at the files."""
    markdown = MarkItDown().convert(source, keep_data_uris=True).markdown
    Path(out_dir).mkdir(exist_ok=True)
    stem = Path(source).stem
    count = 0
    def save(match):
        nonlocal count
        count += 1
        ext = {"jpeg": "jpg", "svg+xml": "svg"}.get(match.group("kind"), match.group("kind"))
        name = f"{out_dir}/{stem}-{count}.{ext}"
        Path(name).write_bytes(base64.b64decode(match.group("data")))
        return f"![{match.group('alt')}]({name})"
    return re.sub(r"!\[(?P<alt>[^\]]*)\]\(data:image/(?P<kind>[a-z0-9.+-]+);base64,(?P<data>[A-Za-z0-9+/=]+)\)", save, markdown)

for source in ("samples/docx-image-alt.docx", "samples/pptx-pictures.pptx", "samples/img-inline.html"):
    result = extract_images(source)
    print(source, "->", [line for line in result.splitlines() if "images/" in line])
print(sorted(p.name for p in Path("images").iterdir()))
```

Output · markitdown 0.1.9 · Python 3.13.18 · 2026-11-15

```
samples/docx-image-alt.docx -> ['![A bar chart of quarterly revenue](images/docx-image-alt-1.png)']
samples/pptx-pictures.pptx -> ['![A bar chart of quarterly revenue](images/pptx-pictures-1.png)', '![chart.png](images/pptx-pictures-2.png)']
samples/img-inline.html -> ['![A chart](images/img-inline-1.png)![Remote](https://example.org/remote.png)']
['docx-image-alt-1.png', 'img-inline-1.png', 'pptx-pictures-1.png', 'pptx-pictures-2.png']
```

[captured result](https://markitdown.dev/evidence/snippets/api-extract-images/result.json)

### Pulling images straight from the file

Office files are ZIP archives and the pictures are in a `media` folder. This extracts them with standard tools, but there is no link from the Markdown to the image:

```python
import zipfile

# Word, PowerPoint and Excel files are ZIP archives; the pictures are in a media folder
for name in ("samples/docx-image-alt.docx", "samples/pptx-pictures.pptx"):
    with zipfile.ZipFile(name) as z:
        print(name, [n for n in z.namelist() if "/media/" in n])
```

Output · markitdown 0.1.9 · Python 3.13.18 · 2026-11-15

```
samples/docx-image-alt.docx ['word/media/image1.png']
samples/pptx-pictures.pptx ['ppt/media/image1.png']
```

[captured result](https://markitdown.dev/evidence/snippets/api-extract-media/result.json)

### Plugins and the image hook

Since release 0.1.8 the DOCX, PPTX and XLSX converters expose an image hook that plugins can override; the OCR plugin uses it. We did not test a plugin that writes image files.

### PDF images

MarkItDown does not extract them, and we did not test an external route.

## Describe images with an LLM

It applies to JPEG and PNG files and to pictures in PowerPoint. The default prompt asks for a detailed description and you can pass your own. For an image file the description comes under a `# Description:` heading; in PowerPoint it is merged with the alt text inside the image reference ([PowerPoint page](https://markitdown.dev/formats/powerpoint/)). If the call fails the conversion raises an error (release 0.1.8 and later).

We ran two small vision models served by Ollama on a four-core CPU-only machine. No key, no hosted service:

````markdown
# Description:
"Quarterly revenue (sample chart) shows a significant increase in Q4 compared to the other quarters, indicating a strong performance in the fourth quarter."
````

*qwen2.5vl-default-prompt-chart.md · 171 bytes*

````markdown
# Description:
The image features a bar graph that displays the quarterly revenue of a company. The graph is divided into four bars, each representing a quarter of the year. The bars are colored in red, with the first bar being the tallest and the last one being the shortest. The graph is set against a white background, making the colors of the bars stand out. The text "Quarterly revenue (sample chart)" is written above the graph, indicating that the graph is a sample chart representing the company's quarterly revenue.
````

*moondream-default-prompt-chart.md · 524 bytes*

The same image, default and custom prompts, two local models
| Model | Prompt | Seconds | Description starts |
| --- | --- | --- | --- |
| `moondream` | default prompt | 8.9 | \# Description: The image features a bar graph that displays the quarterly revenue of a company. The graph is divided into four bars, each representing a quarter of the year. The bars are colored in red, with the first ba |
| `moondream` | custom prompt | 8.1 | \# Description: The image features a bar graph that displays the quarterly revenue of a company. The graph is divided into four bars, each representing a quarter of the year. The bars are colored in red, with the first ba |
| `moondream` | Spanish prompt | 8.8 | \# Description: The image features a bar graph that displays the quarterly revenue of a company. The graph is divided into four bars, each representing a quarter of the year. The height of each bar indicates the revenue g |
| `qwen2.5vl:3b` | default prompt | 31.9 | \# Description: "Quarterly revenue (sample chart) shows a significant increase in Q4 compared to the other quarters, indicating a strong performance in the fourth quarter." |
| `qwen2.5vl:3b` | custom prompt | 28.7 | \# Description: The image is a bar chart titled "Quarterly revenue (sample chart)" with four bars representing Q1, Q2, Q3, and Q4. |
| `qwen2.5vl:3b` | Spanish prompt | 29.0 | \# Description: Esta imagen muestra un gráfico de barras que representa los ingresos trimestrales (Q1, Q2, Q3, Q4) de una empresa, con Q4 mostrando el mayor ingreso. |
| `no-such-model` | wrong model name | 0.0 |  |
| `moondream` | nothing listening | 0.0 |  |
| `moondream` | timeout of 1 ms | 0.0 |  |

*The same image, default and custom prompts, two local models Source: Test T10 · run 43763286968 · llm-providers.csv · Download CSV*

Setup, providers and cost: [the LLM page](https://markitdown.dev/llm/). Hosted models are not tested by us.

## Converting a JPEG or PNG on its own

-   **Without ExifTool and without an LLM client:** exit code 0 and an **empty** output, for a PNG and for a JPEG with EXIF data.
-   **With ExifTool installed:** `Field: value` lines of the metadata ExifTool finds:

````markdown
ImageSize: 640x360
Artist: MarkItDown pilot
````

*img-I10-exiftool.md · 44 bytes*

-   **ExifTool version:** versions older than 12.24 are refused with an error that names CVE-2021-22204.

Reproduced by us

### ImageConverter threw RuntimeError with message: ExifTool version 12.16 is vulnerable to CVE-2021-22204. Please upgrade to version 12.24 or later.

MarkItDown refuses to run an ExifTool older than 12.24.

Affected: 0.1.3 and later with ExifTool older than 12.24 · last reproduced 2026-11-15 · [Upstream report](https://github.com/microsoft/markitdown/issues/1434)

-   **Installing it,** and telling MarkItDown where it is with `EXIFTOOL_PATH` (a wrong path gave `Failed to invoke exiftool at …`; [environment variables](https://markitdown.dev/cli/)):

**Windows**

```bash
winget install --id OliverBetz.ExifTool --exact
```

**macOS**

```bash
brew install exiftool
```

**Ubuntu and Debian**

```bash
sudo apt-get install -y libimage-exiftool-perl
```

-   **With an LLM client:** the metadata plus the description.
-   **Other image types:** GIF, BMP, TIFF and WebP raise `UnsupportedFormatException`; convert them to PNG first (Pillow does it in one line). SVG is echoed as its XML source. We did not test HEIC. We did not test a file with GPS data, but ExifTool's output is printed as it comes, so check your files before sharing the Markdown.

## Which route for which job

| Goal | Route | Effect on output |
| --- | --- | --- |
| Archive a document with its pictures | Keep data URIs, or extract the files with the script | Output grows, from 44 to 11,246 characters for one small picture |
| Feed a language model text only | The default | Placeholders only |
| Feed a multimodal model | Extract the files, send them separately | Text plus images |
| Make charts searchable | An LLM description, or PowerPoint charts (they become data tables) | Text, at 9 to 90 seconds per image on a CPU |
| Scanned pages | [OCR](https://markitdown.dev/ocr/) | Text from the image |

## Related

- [LLM image descriptions](https://markitdown.dev/llm/): Setting up an LLM client, providers and cost.
- [OCR and scanned files](https://markitdown.dev/ocr/): Reading text inside pictures and scanned pages.
- [Word (DOCX)](https://markitdown.dev/formats/word/): Word files, including pictures.
- [PowerPoint (PPTX)](https://markitdown.dev/formats/powerpoint/): PowerPoint files, including pictures.
- [Supported formats](https://markitdown.dev/formats/): How every file type converts.

---
Independent guide to the open-source MarkItDown library. Not affiliated with or endorsed by Microsoft. Official source: https://github.com/microsoft/markitdown
