// A 16-bit, 4-band GeoTIFF: show bands 3, 2, 1 (red, green, blue), stretched on the raw values.
const data = await tiff.getImage().then((i) => i.readRasters({ interleave: true }));
const img = rasterToImageData({ data, width, height, bands: 4, select: [2, 1, 0], noData: 0 });
const out = await pipeline().contrast(0.1).sharpen().run(img);
Stretches a raster to an 8-bit sRGB image (
ImageData) that pipelines can correct: raw values from black to white map linearly onto 0-255, values outside are clipped, and transparent, no-data and NaN pixels become transparent. One picture band gives a gray image, three give color.