gif_cli 1.0.1 copy "gif_cli: ^1.0.1" to clipboard
gif_cli: ^1.0.1 copied to clipboard

An interactive CLI to convert image sequences into animated GIFs.

example/example.dart

import 'dart:io';

import 'package:gif_cli/gif_cli.dart' as gif;

// Although gif_cli is meant to be used as a CLI, you could also use
// it in your own Dart app as shown in this example.

// There's a very simple 7 frame animation inside the example/frames directory.
// It was rendered as a sequence of PNG images because Blender (the software
// used to produce the animation) doesn't export to GIF.
// Sounds like a perfect use case.

void main(List<String> args) async {
  var framesDir = Directory('example/frames');
  var sequences = await gif.findSequences(framesDir);

  // There should be only a single sequence,
  // as all frames share the same prefix and suffix ("cube" ... ".png").
  var cubeSequence = sequences.first;

  // Set the image sequence's designated framerate.
  cubeSequence.inputFps = 8;

  var output = await cubeSequence.convertToGif(File('example/cube.gif'));

  print('Converted to "${output.path}"');
}
0
likes
40
pub points
0%
popularity

Publisher

verified publishertheoretically.online

An interactive CLI to convert image sequences into animated GIFs.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

path, prompts

More

Packages that depend on gif_cli