how to save image in the markdown
The image in the markdown is represented as this: . How can I save images?
Can you show an example?
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("test.pdf")
print(result.text_content)
md_file = 'text.md'
with open(md_file, 'w') as f:
f.write(result.text_content)
I'm write code like this. In file text.md, only text saved, the image part shows like [](.data/image:base64...), I couldn't find this figure.
- How to get this base64 image directly from function md.convert("test.xlsx")?
- How to save images?
up
I have documents with embedded images that I would like to convert to markdown, so this feature would be helpful for me.
Currently when exporting it exports like this (exact quote):

I could see two resolutions:
- Complete the embedded image data
. I think this would work display correctly when rendering markdown. - Add an option to export embedded images as files in a particular directory and create relative links to them.
Same problem, base64 data shoul be in the data-url or file saved, neither are there.. just  ie.. "..." were the base64 image data should be
Same problem. I convert word to md, all the image embedded in the document convert to just 
Refer to issues51
Modify the file packages/markitdown/src/markitdown/converters/_markdownify.py, comment out the following code.
# if src.startswith("data:"):
# src = src.split(",")[0] + "..."
Reinstall it and you're done.
pip install -e packages/markitdown
Now it works!
@.***>谢谢!
What's the meaning of view on web? image can't be visit ed locally?
---Original--- From: @.> Date: Mon, Feb 17, 2025 16:24 PM To: @.>; Cc: "Optimus @.@.>; Subject: Re: [microsoft/markitdown] how to save image in the markdown (Issue#162)
Refer to issues51
Modify the file packages/markitdown/src/markitdown/converters/_markdownify.py, comment out the following code.
if src.startswith("data:"): # src = src.split(",")[0] + "..." image.png (view on web)
Reinstall it and you're done.
pip install -e packages/markitdown
Now it works!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> SnakeHacker left a comment (microsoft/markitdown#162)
Refer to issues51
Modify the file packages/markitdown/src/markitdown/converters/_markdownify.py, comment out the following code.
if src.startswith("data:"): # src = src.split(",")[0] + "..." image.png (view on web)
Reinstall it and you're done.
pip install -e packages/markitdown
Now it works!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
What's the meaning of view on web? image can't be visit ed locally? …
This is merely a matter of omission, as the new version aims to conserve tokens for llm.
If I want to get and save the raw image, how to do?
---Original--- From: @.> Date: Mon, Feb 17, 2025 17:03 PM To: @.>; Cc: "Optimus @.@.>; Subject: Re: [microsoft/markitdown] how to save image in the markdown (Issue#162)
What's the meaning of view on web? image can't be visit ed locally? …
This is merely a matter of omission, as the new version aims to conserve tokens for llm.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> SnakeHacker left a comment (microsoft/markitdown#162)
What's the meaning of view on web? image can't be visit ed locally? …
This is merely a matter of omission, as the new version aims to conserve tokens for llm.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Base 64 images are now optionally maintained (in #1140)
@.***>谢谢!