browser-image
    Preparing search index...
    • Takes the bands select names out of a band-interleaved raster, in that order: [3, 2, 1] of a 4-band image gives a 3-band raster of bands 3, 2 and 1. The alpha band (alpha: true) is kept as the last band. Values are copied as they are, into an array of the input's type, so 16-bit and float data keep their precision; rasterToImageData then stretches them for display (it also takes select, so the two steps can be one).

      Type Parameters

      • T extends ArrayLike<number>

      Parameters

      • raster: Raster & { data: T }
      • select: readonly number[]

      Returns SelectedBands<T>

      // Sentinel-2 bands B2, B3, B4, B8 (blue, green, red, near-infrared): a false-color composite.
      const falseColor = selectBands({ data, width, height, bands: 4 }, [3, 2, 1]);