# Copy image from VSCODE

**URL:** <https://discourse.julialang.org/t/copy-image-from-vscode/64204>\
**Category:** General Usage\
**Tags:** question, vscode, plots\
**Created:** [July 7, 2021, 10:46am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204 "2021-07-07T10:46:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [July 7, 2021, 10:46am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/1 "2021-07-07T10:46:49Z")

</div>

What is the correct way to copy an image from the edit area, in VSCode?  
When using the copy command (right click on the image) the image is not copied, to be able to copy it in Word, Paint, …, etc.

 ![copy from VSCode](https://global.discourse-cdn.com/julialang/original/3X/1/b/1b5eeba82f0e6a15a75956ddd8080abeb5da0e50.jpeg)

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [July 7, 2021, 10:51am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/2 "2021-07-07T10:51:17Z")

</div>

You could try and save the plot as an image (or pdf), see  
[https://stackoverflow.com/questions/62981391/how-to-save-plot-in-julia](https://stackoverflow.com/questions/62981391/how-to-save-plot-in-julia)

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [July 7, 2021, 10:54am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/3 "2021-07-07T10:54:36Z")

</div>

Perhaps even better reference is the manual [Output · Plots](https://docs.juliaplots.org/latest/output/).

---

<div class="post-metadata">

**Author:** ![bvrb](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bvrb](https://discourse.julialang.org/u/bvrb)\
**Post date:** [July 7, 2021, 11:56am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/4 "2021-07-07T11:56:17Z")

</div>

If I understood correctly, you want to directly copy the image from VSCode to the clipboard, without saving it to disk as an intermediate step.

For me, it only worked if I selected the image first (i.e. dragging my mouse (starting outside the image borders) over the image until it was highlighted blue) and then right-clicking and selecting Copy.  
Although I agree it would be slightly more convenient if one could just directly use right-click → Copy.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [July 7, 2021, 12:25pm UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/5 "2021-07-07T12:25:12Z")

</div>

Yes, is that or what I’m looking for.  
I just did the procedure you describe, and I can’t copy it, in word or paint. Apparently there is no copy of the image on clickboard

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [July 7, 2021, 12:34pm UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/6 "2021-07-07T12:34:54Z")

</div>

We’ll get native support for this soonish, hopefully:

> <https://github.com/julia-vscode/julia-vscode/pull/2267>
>
> Add \`Save Plot\` button, fixes #424.
> Add \`Copy Plot\` button, fixes #172.
> 
> \- \[x…\] End-user documentation check.
> \- \[x\] Changelog mention.
> 
> \##
> \- Relying on the graphical backends turned out to a bit problematic because it will need to keep a reference to the code which produced the plot.
> \- Even if the complexity of storing the code which produced the plot is acceptable, it won't work for calls to \`plot\` with mutable data e.g., \`plot(1:10, rand(10))\`.
> \- Instead, save the SVG displayed in the plot pane.

---

<div class="post-metadata">

**Author:** ![bvrb](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bvrb](https://discourse.julialang.org/u/bvrb)\
**Post date:** [July 7, 2021, 12:39pm UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/7 "2021-07-07T12:39:51Z")

</div>

I assume you are on Windows? The procedure described (highlighting the image first and then copying) worked for me on Linux (Ubuntu 20.04), I was then able to paste it with CTRL+V into LibreOffice.

Unfortunately I do not have access to a Windows setup to try it out there… Sorry I couldn’t be of more help! But it is good to know a native julia-vscode extension solution seems to be on the horizon.

---

<div class="post-metadata">

**Author:** ![vancleve](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vancleve/32/4183_2.png) [@vancleve](https://discourse.julialang.org/u/vancleve)\
**Post date:** [July 7, 2021, 5:28pm UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/8 "2021-07-07T17:28:51Z")

</div>

On MacOS, you can drag the plot to Chrome, where it opens as an .svg. Very handy!

---

<div class="post-metadata">

**Author:** ![thompsonmj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thompsonmj/32/25172_2.png) [@thompsonmj](https://discourse.julialang.org/u/thompsonmj)\
**Post date:** [August 20, 2021, 2:46pm UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/9 "2021-08-20T14:46:01Z")

</div>

This works on Windows with Chrome as well. Then you can right-click and save as a file.

Didn’t work with Firefox or Edge, though.

I guess another workaround would be a screen clip with the Snipping Tool or Snip & Sketch for Windows and Command + Shift + 4 on Mac.

@pfitzseb, looking forward to the next minor release with this PR!

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [November 8, 2024, 9:24am UTC](https://discourse.julialang.org/t/copy-image-from-vscode/64204/10 "2024-11-08T09:24:46Z")

</div>

Same problem here in 2024 (Ubuntu 20.04) … I have never been able to copy plots from VSCode to be honest, either right click or going into the Julia menu “Copy plot”.

Of course I can save the plot, but just copy/paste sometimes would be more convenient.

I haven’t understood the “workaround” proposed by some of you…
