Attaching pictures to a note

Searched in tutorials, but couldn’t find the answer, hence, asking here. How do I attach a png picture to my note? Thank you.

[[picture.png]] will make a link and ![[picture.png]] will embed the picture.

11 Likes

Thank you, linking and embedding look easy. But how do I insert the picture in the note? Step 1, convert png to md (?)? What is step 2?

just trying to understand the situation correctly, instead of using a PNG file in the folder, you want to embed the image itself( not the file) into note?

If that’s the case, you can copy paste base64 encoded version of the image. If that’s what you’re after, ı can paste an example snippet

Yes, I’d like to embed the image in your words. But for the sake of exercising, I’d like to know how to use a png file in the folder (is that the folder in PC or in the vault? Sorry, as you can see I’m a total diletant). I’d like to see the example snippet. Thank you.

1 Like

In that here are the steps:

  1. in terminal run the command base64 picture.png
  2. copy the output (it might be long!, thus you can use a program to copy in terminal, such as xclip or xbcopy(?))
  3. in markdown file, type ![](data:image/png;base64, and then paste the base64 encoded image content, then close the parenthesis.

I hope this was what you asked for. base64 is available for Linux and Mac, not sure about Windows.

3 Likes

Thank you!

as a shortcut, which is what I often use, you can just drag and drop your PNG image in the obsidian editor.

Obsidian will make a copy of this PNG image in your default attachment folder, and also embed this in your md file.

14 Likes

Huge thanks! This seems a lot easier.

You can drag-and-drop image into writing-area.

However, I suggest developer should add “insert image” button.

1 Like

I’ve been trying to embed images into my ‘notes’ - found this thread…

hahattpro “You can drag-and-drop image into writing-area.”

When I do that I only see a ‘link’ like this: ![[image.jpg]] and not the picture itself… is there a setting I haven’t enabled or something?

It would certainly be amazing if the picture was there alongside the writing…

Any way to do it?

Thanks

2 Likes

I think they are talking about images that are already downloaded, no the ones on the internet.

I found this behavior unexpected as well. When I try to drag and drop from the web, you get a link. If you drag and drop a file that is already on your local machine, then it copies it into your specified attachment folder. Like others have said, a context menu for adding an image, or a prompt when you drag and drop images from the web (e.g., do you want to “insert a hyperlink to the online image” or “download and link to a copy in your attachments folder” would be a nice feature.

6 Likes

What happens if you switch to Preview mode? Do you still see only “![[image.jpg]]” or you see your image?

Hello, I was searching for a solution to show a base64-encoded image in my note. I used the solution from above, but the image wasn’t shown, only the encoded stuff. So the code number 3 didn’t work in my note.

I found a HTML-based solution like this (image was shown):

<div><img src="data:image/png;base64,/9j/4AAQS...viel Zeugs ...ZRRB//Z"/></div>

I used png- and jpeg-images for my tests.

But I normally don’t want to use HTML-code in my notes.

What can be the reason, that the first code missed?

Greets Jopii

@blue-moves there is a Community Plugin called “Ozan’s Image in Editor Plugin” that enables viewing the picture in both Edit and Preview.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.