function requestViaImage(url, additionalAttributes) {
  const img = createElement(
      "img",
      // crossOrigin attribute is added to read the pixel data of the response.
      Object.assign({"src": url, "crossOrigin": "Anonymous"}, additionalAttributes),
      document.body, true);
  return img.eventPromise.then(() => wrapResult(decodeImageData(img)));
}
Creates a new image, binds load and error events, sets the src attribute and
    appends it to {@code document.body} .
@param {string} url The src for the image.
@return {Promise} The promise for success/error events.