gray method

  1. @override
FutureOr<String?> gray(
  1. Uint8List imageData
)
override

Implementation

@override
FutureOr<String?> gray(Uint8List imageData)
{
  // get decoder
  final decoder = findDecoderForData(imageData);
  if (decoder == null) return null;

  // decode image
  Image? image = decoder.decode(imageData);
  if (image != null)
  {
    image = grayscale(image);
    return _encode(image, decoder);
  }
  return null;
}