async function arrayToJimp(imageData) {
  const bufferLen = IMAGE_HEIGHT * IMAGE_WIDTH * 4;
  const buffer = new Uint8Array(bufferLen);

  let index = 0;
  for (let i = 0; i < IMAGE_HEIGHT; ++i) {
    for (let j = 0; j < IMAGE_WIDTH; ++j) {
      const inIndex = (i * IMAGE_WIDTH + j);
      const val = imageData[inIndex] * 255;
      buffer.set([Math.floor(val)], index++);
      buffer.set([Math.floor(val)], index++);
      buffer.set([Math.floor(val)], index++);
      buffer.set([255], index++);
    }
  }

  return new Promise((resolve, reject) => {
    new jimp(
        {data: buffer, width: IMAGE_WIDTH, height: IMAGE_HEIGHT},
        (err, img) => {
          if (err) {
            reject(err);
          } else {
            resolve(img);
          }
        });
  });
}
Convert an image represented as a typed array to a JIMP object.

@param {Float32Array} imageData

@returns {Promise[Jimp]} Jimp object representing image.