Skip to content
Back to blog
Sunday, December 6, 2026

How to Resize an Image in Markdown and Export to PNG

Set the width of an embedded Markdown image, keep its proportions, and check the pixel dimensions of the finished PNG.

How to Resize an Image in Markdown and Export to PNG

An image that fits a README can fill an entire card when you paste it into a Markdown editor. Give the embedded image a width first, then download the whole card and inspect it at the size people will see. The example below uses the same trail note twice so you can compare the two sizes with one copy and paste.

Set a width that preserves the proportions

In ![description](url), CommonMark gives the renderer a description and an image URL. The renderer decides how much room the image gets. When the editor allows HTML, use <img> with src, alt, and a numeric width. For example, width="360" requests 360 CSS pixels. Leave out height so the image can keep its original proportions. A theme can still shrink the image to fit a narrower column. CommonMark image syntax · HTML image attributes

Keep the syntax that fits the destination. Pandoc can read {width=360} after a Markdown image when its link_attributes extension is enabled. For an editor that filters out HTML and accepts standard Markdown, resize a copy of the source file and embed it with ![description](url). Preview the copy there because the destination's styles can still determine how large it looks. Pandoc link and image attributes

Paste this comparison into the editor

The first image uses standard Markdown to let the editor size the picture. The second embeds the same trail note through HTML and sets the width to 360. Both refer to a 1394 × 456 PNG, and both keep a description of the bridge and shortcut. The sample URL points directly to the image file, so the note can load in other editors. Open the source PNG

# North loop briefing

## Default image

![Trail note: bridge open, ridge shortcut closed after rain](https://directus-markdown2image.aimazing.site/assets/9149a56f-b565-433f-9e84-14fe6c32b4b0)

## Image with width 360

<img src="https://directus-markdown2image.aimazing.site/assets/9149a56f-b565-433f-9e84-14fe6c32b4b0" alt="Trail note: bridge open, ridge shortcut closed after rain" width="360">

Meet at the visitor center at **09:00**.

In the desktop preview, the browser laid out the first picture at about 622 CSS pixels wide. The HTML version took up 360 × 118 CSS pixels before the editor scaled the preview to fit the panel.

Download the card and check its pixel dimensions

  1. Open the Markdown to Image converter and paste the full example into the editor.
  2. Switch to Preview. Wait for both notes to load. Check that the second is narrower and that the final line with the meeting time still fits.
  3. In Settings → Output, choose PNG if you have another format selected. Choose Download image, then open the file and check its dimensions. The frame includes the headings, both pictures, the time, and the space around them.

The downloaded trail briefing shows the same note first at the default width and then at a smaller width.

The image above is the 1340 × 1516 PNG we downloaded directly from the English production converter on December 6, 2026. It includes the converter's footer. The preview measurements describe one embedded picture. The file dimensions describe the whole export.

Fix a mismatch between the preview and the export

What you seeWhat to check
Both pictures are the same widthA narrow column may cap both at the same size. Test at desktop width or request a smaller width for the second picture.
The HTML shows up as text or disappearsCheck whether the editor accepts raw HTML. If it filters the tag, use a resized source file with standard Markdown.
The image looks stretchedRemove an explicit height, then preview at the intended width. If you need both values, calculate height = width × original height ÷ original width.
The preview loads but the export is missing a pictureOpen the image URL in a private window and check it serves the file itself. Try a direct image URL that the renderer can access.
The overall card is too wideAdjust the image width in Settings → Output or resize the finished PNG. Use the embedded width to change just the picture inside the card.

The first download had two blank image areas even though both notes appeared in the preview. We reopened the converter in an English browser session, confirmed both pictures had loaded, and downloaded the complete PNG shown here. Open the downloaded file before sending it.

Share a card people can read

View the downloaded card at the width it will have in your team chat, event post or slides. If the trail note becomes hard to read, move the bridge status and meeting time into the post caption. Keep the Markdown with the original image so you can change the layout next time. For help tracing broken paths or writing descriptions for your own images, use the guide to images in Markdown.