function createLoader(options) {
  const load = options.load || decode;
  const ratio = options.ratio ?? 1;
  const crossOrigin = options.crossOrigin ?? null;

  /** @type {import('../Image.js').ImageObjectPromiseLoader} */
  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);
    return load(image, src).then((image) => ({image, extent, pixelRatio}));
  };
}
Creates a loader for MapServer images generated using the CGI interface,
which predates OGC services. It is **strongly** recommended to configure
MapServer to use WMS, and use the WMS createLoader.
@param {LoaderOptions} options LoaderOptions Options.
@return {import('../Image.js').ImageObjectPromiseLoader} MapServer image.
@api