# Take image of my render with JS and save it

**URL:** <https://discourse.threejs.org/t/take-image-of-my-render-with-js-and-save-it/17390>\
**Category:** Questions\
**Tags:** webgl-renderer\
**Created:** [July 25, 2020, 12:13pm UTC](https://discourse.threejs.org/t/take-image-of-my-render-with-js-and-save-it/17390 "2020-07-25T12:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![threejsisdope](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@threejsisdope](https://discourse.threejs.org/u/threejsisdope)\
**Post date:** [July 25, 2020, 12:13pm UTC](https://discourse.threejs.org/t/take-image-of-my-render-with-js-and-save-it/17390/1 "2020-07-25T12:13:41Z")

</div>

So after I have rendered my object, how can I make t so that when the page is loaded, it takes a image and saves it?

---

<div class="post-metadata">

**Author:** ![jacopocolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jacopocolo/32/10521_2.png) [@jacopocolo](https://discourse.threejs.org/u/jacopocolo)\
**Post date:** [July 25, 2020, 2:16pm UTC](https://discourse.threejs.org/t/take-image-of-my-render-with-js-and-save-it/17390/2 "2020-07-25T14:16:19Z")

</div>

It should be as easy as passing the renderer to toDataURL and then passing the var to a new image.

```auto
renderer.render(scene, camera);
var imgData = renderer.domElement.toDataURL();
var img = new Image();
img.src = imgData;
```

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [July 25, 2020, 5:56pm UTC](https://discourse.threejs.org/t/take-image-of-my-render-with-js-and-save-it/17390/3 "2020-07-25T17:56:22Z")

</div>

Seems to be a duplicate of this stackoverflow thread:

> <https://stackoverflow.com/questions/26193702/three-js-how-can-i-make-a-2d-snapshot-of-a-scene-as-a-jpg-image>

@threejsisdope Please make sure to sufficiently search for existing answers before asking a new question.
