encodePngFile function
Encode an image
to a PNG file at the given path
.
Implementation
Future<bool> encodePngFile(String path, Image image,
{bool singleFrame = false,
int level = 6,
PngFilter filter = PngFilter.paeth}) async {
if (!supportsFileAccess()) {
return false;
}
final bytes = PngEncoder(level: level, filter: filter)
.encode(image, singleFrame: singleFrame);
return writeFile(path, bytes);
}