save method

Future<void> save(
  1. String filePath
)

Saves this PImage to a file at the given filePath.

The filePath must include the file extension, and the extension determines the file format. The extension can be one of: ".png", ".jpg", ".tiff", ".tga".

Implementation

Future<void> save(String filePath) async {
  final file = File(filePath);
  saveBytesToFile(
    file: file,
    imageData: _pixels.buffer.asUint8List(),
    width: width,
    height: height,
  );
}