# Help. How to read a 16 bit grayscale image now JAI is no more?

**URL:** <https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071>\
**Category:** Libraries\
**Created:** [May 9, 2019, 3:39pm UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071 "2019-05-09T15:39:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rapatski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rapatski/32/5164_2.png) [@rapatski](https://discourse.processing.org/u/rapatski)\
**Post date:** [May 9, 2019, 3:39pm UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071/1 "2019-05-09T15:39:38Z")

</div>

Hey guys,  
Now the JAI library is deprecated, I am a little bit at a loss on how to read a 16bit grayscale heightmap in Processing. Can anyone recommend a format that’s easier to read, or a replacement imaging library or workaround?

Appreciated!

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 13, 2019, 6:43am UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071/2 "2019-05-13T06:43:31Z")

</div>

Could you say a but more about what your goal is, specifically? Are you loading data in a fixed format – from files, sensors? – and trying to display it on screen as PImage? Could you link to JAI deprecation you mention?

---

<div class="post-metadata">

**Author:** ![rapatski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rapatski/32/5164_2.png) [@rapatski](https://discourse.processing.org/u/rapatski)\
**Post date:** [May 13, 2019, 1:15pm UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071/3 "2019-05-13T13:15:54Z")

</div>

I was using using JAI to load a 16bit grayscale image (a depthmap) into a BufferedImage, just to read the brightness data and convert to a 3D model (relief). The level of precision is exactly why 8bit images didn’t suffice.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 13, 2019, 3:56pm UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071/4 "2019-05-13T15:56:13Z")

</div>

Have you taken a look at ImageJ? I used to use it for 16bit grayscale, although not with Processing directly.

Interesting example of a similar discussion by GeoTools [https://github.com/geotools/geotools/wiki/Replace-JAI](https://github.com/geotools/geotools/wiki/Replace-JAI)

I think @cansik has also worked with ImageJ before, but I’m not sure in what way.

Here are some old ImageJ plus processing threads from the old forum:

- [https://forum.processing.org/two/discussion/2924/porting-imagej-to-processing-a-first-class-videowriter](https://forum.processing.org/two/discussion/2924/porting-imagej-to-processing-a-first-class-videowriter)
- [https://forum.processing.org/two/discussion/13979/could-someone-post-some-pseudo-code-on-implementing-clahe-in-processing](https://forum.processing.org/two/discussion/13979/could-someone-post-some-pseudo-code-on-implementing-clahe-in-processing)

---

<div class="post-metadata">

**Author:** ![rapatski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rapatski/32/5164_2.png) [@rapatski](https://discourse.processing.org/u/rapatski)\
**Post date:** [May 15, 2019, 8:44am UTC](https://discourse.processing.org/t/help-how-to-read-a-16-bit-grayscale-image-now-jai-is-no-more/11071/5 "2019-05-15T08:44:55Z")

</div>

Ah nice thanks, let me take a look!
