toImage static method

Image toImage(
  1. TiffImage page
)

Converts a decoded TIFF page to an 8-bit RGBA image.Image, applying its PhotometricInterpretation (same color handling as TiffImage.decodeRgba8).

Implementation

static img.Image toImage(TiffImage page) {
  final rgba = page.decodeRgba8();
  return img.Image.fromBytes(
    width: page.metadata.width,
    height: page.metadata.height,
    bytes: rgba.buffer,
    numChannels: 4,
    order: img.ChannelOrder.rgba,
  );
}