fromPNG static method

QOI fromPNG(
  1. Uint8List raw, {
  2. Channels? overrideChannels,
  3. int? overrideColorspace,
})

Decode from a PNG image, using the Image library

Implementation

static QOI fromPNG(
  Uint8List raw, {
  Channels? overrideChannels,
  int? overrideColorspace,
}) {
  final Image image = PngDecoder().decodeImage(raw)!;

  return QOI.fromRaw(
    bytes: image.getBytes(),
    width: image.width,
    height: image.height,
    channels: overrideChannels ?? image.channels,
    colorspace: overrideColorspace ?? 0,
  );
}