# itk-js: Create Image from Buffer

**URL:** https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847
**Category:** Beginner Questions
**Tags:** itk-js, javascript
**Created:** [March 18, 2020, 11:35am UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847 "2020-03-18T11:35:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Athius](https://discourse.itk.org/user_avatar/discourse.itk.org/athius/32/304_2.png) [@Athius](https://discourse.itk.org/u/Athius)
#### Post date: [March 18, 2020, 11:35am UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/1 "2020-03-18T11:35:52Z")

</div>

Hi everyone,

I have some application that transfert a json file that contains buffer of pixels, image dimension, spacing, origin and type of each pixels (int, unsigned int, etc…). I can’t use a standard format like nrrd, Nifti, etc…

Is it possible to create an Image in javascript from those informations? I didn’t find anything on the examples.

Thank you.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [March 18, 2020, 5:03pm UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/2 "2020-03-18T17:03:03Z")

</div>

Hello Romain,

Yes, a JavaScript Object can just be created as described here:

[http://insightsoftwareconsortium.github.io/itk-js/api/Image.html](http://insightsoftwareconsortium.github.io/itk-js/api/Image.html)

HTH,  
Matt

---

<div class="post-metadata">

### Author: ![Athius](https://discourse.itk.org/user_avatar/discourse.itk.org/athius/32/304_2.png) [@Athius](https://discourse.itk.org/u/Athius)
#### Post date: [March 19, 2020, 3:56pm UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/3 "2020-03-19T15:56:39Z")

</div>

Hello Matt,

I just saw the documentation…  
Thanks you so much 🙂

---

<div class="post-metadata">

### Author: ![mwlw](https://discourse.itk.org/user_avatar/discourse.itk.org/mwlw/32/2342_2.png) [@mwlw](https://discourse.itk.org/u/mwlw)
#### Post date: [November 5, 2021, 6:26pm UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/4 "2021-11-05T18:26:11Z")

</div>

Hi there,  
this link you have provided is not working for me. Is there a new location for the docs?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 5, 2021, 6:53pm UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/5 "2021-11-05T18:53:53Z")

</div>

`itk.js` is currently undergoing refactoring, that might be the reason. @matt.mccormick should be back in office next week, he will know where are the old and new docs.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [November 12, 2021, 3:05pm UTC](https://discourse.itk.org/t/itk-js-create-image-from-buffer/2847/6 "2021-11-12T15:05:44Z")

</div>

Hi,

The docs are now here:

> **[itk-wasm](http://insightsoftwareconsortium.github.io/itk-wasm/)**
>
> itk-wasm

itk.js is migrating to _itk-wasm_ 🎇 💖 . If you are coming from itk.js, please see the [migration guide](https://insightsoftwareconsortium.github.io/itk-wasm/docs/itk_js_to_itk_wasm_migration_guide.html).
