encodeGifFile function
Encode an image
to a GIF file at the given path
.
Implementation
Future<bool> encodeGifFile(String path, Image image,
{bool singleFrame = false,
int repeat = 0,
int samplingFactor = 10,
DitherKernel dither = DitherKernel.floydSteinberg,
bool ditherSerpentine = false}) async {
if (!supportsFileAccess()) {
return false;
}
final bytes = GifEncoder(
samplingFactor: samplingFactor,
dither: dither,
ditherSerpentine: ditherSerpentine)
.encode(image, singleFrame: singleFrame);
return writeFile(path, bytes);
}