function createLoader(options) {
  const load = options.load || decode;
  const useOverlay = options.useOverlay ?? false;
  const metersPerUnit = options.metersPerUnit || 1;
  const displayDpi = options.displayDpi || 96;
  const ratio = options.ratio ?? 1;
  const crossOrigin = options.crossOrigin ?? null;

  return function (extent, resolution, pixelRatio) {
    const image = new Image();
    image.crossOrigin = crossOrigin;
    extent = getRequestExtent(extent, resolution, pixelRatio, ratio);
    const width = getWidth(extent) / resolution;
    const height = getHeight(extent) / resolution;
    const size = [width * pixelRatio, height * pixelRatio];
    const src = getUrl(
      options.url,
      options.params,
      extent,
      size,
      useOverlay,
      metersPerUnit,
      displayDpi,
    );
    return load(image, src).then((image) => ({image, extent, pixelRatio}));
  };
}
Creates a loader for MapGuide images.
@param {LoaderOptions} options Image ArcGIS Rest Options.
@return {import('../Image.js').ImageObjectPromiseLoader} ArcGIS Rest image.
@api