• 100% IN-BROWSER
PROCESSED: 687
Back to Resources Hub
★ BRAND NEW STRATEGYAug 9, 2026 • 5 min read

Base64 Markdown Image Compression for Multimodal Vision prompts

Why high-quality base64 strings hang text editors and exhaust tokens, and how canvas scaling to 400px saves up to 95% of data sizes.

1. The Problem with Large Base64 Embeds

Adding images to Markdown via inline base64 tags (`![alt](data:image/png;base64,...)`) is incredibly convenient for bundling document assets. However, a typical 5MB high-resolution smartphone photo converts into a base64 string that is roughly **6.8 million characters long**.

Dumping this huge string into your Markdown notes or LLM prompt history will crash text editors and exhaust context window token limits.

2. The 400px Canvas Solution

To solve this, ILoveMD integrates client-side canvas-based image compression. By downscaling image dimensions (e.g. capping at 400px max width) and encoding as a JPEG with a 0.5 quality factor, we compress the data URL down to **under 25KB**—a 96% reduction! This provides a visual thumbnail for your agents while keeping tokens light.

Try it live in Image to Markdown

Our Image to MD tool extracts text via OCR, and appends a compressed visual base64 tag at the bottom of the result.