- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2025 05:44 AM
Hi everyone,
Here’s an easy way to embed images into Databricks notebook cells, using markdown or code:
1. Drag and drop images directly into Markdown cells
You can simply drag an image file from your local system into a markdown cell. Databricks will upload it automatically to your workspace directory and display it inline in the cell.
2. Reference images stored in the workspace or volumes
If your image already resides in the workspace storage or a Unity Catalog volume, you can display it using standard markdown syntax. Use either an absolute path (starting from the root of the workspace or volume) or a relative path. For example:
%md

or
%md

Similarly, reference images stored in volumes with an absolute volume path:
%md

3. Use displayHTML to render custom HTML including images
If you need more control—like sizing or positioning—you can use HTML in your notebook. Use the displayHTML() function to render custom HTML, including <img> tags. For example:
displayHTML('<img src="/Workspace/absolute/path/to/your_image.png" width="300" />')
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa