encodeGifFile function

Future<bool> encodeGifFile(
  1. String path,
  2. Image image, {
  3. bool singleFrame = false,
  4. int repeat = 0,
  5. int samplingFactor = 10,
  6. DitherKernel dither = DitherKernel.floydSteinberg,
  7. bool ditherSerpentine = false,
})

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);
}