Manipulating GIF files

Support of export readable full frame gif to multipage image formats

Aspose.Imaging supports for full-frame export from gif format.

String baseDirectoryPath = "D:\\";
String fileName = "Animation.gif";
String inputFilePath = baseDirectoryPath + fileName;
String outputFilePath = inputFilePath + "_FullFrame.tif";
String outputFilePath1 = inputFilePath + "_NonFullFrame.tif";
try (Image image = Image.load(inputFilePath))
{
MultiPageOptions multiPageOptions = new MultiPageOptions(new IntRange(2, 5));
TiffOptions tiffOptions = new TiffOptions(TiffExpectedFormat.TiffDeflateRgb);
tiffOptions.setMultiPageOptions(multiPageOptions);
tiffOptions.setFullFrame(true);
image.save(outputFilePath, tiffOptions);
tiffOptions.setFullFrame(false);
image.save(outputFilePath1, tiffOptions);
}

Support set of gif frame duration for all frames and option of the number of cycles in the GIF animation

Aspose.Imaging supports settting of gif frame duration and option of the number of cycles in the GIF animation

import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.gif.GifImage;
import com.aspose.imaging.fileformats.gif.blocks.GifFrameBlock;
import com.aspose.imaging.imageoptions.GifOptions;
String filepath = "ezgif.com-gif-maker(1)___.gif";
String outputPath = "output.gif";
try (GifImage image = (GifImage)Image.load(filepath))
{
image.setFrameTime(2000);
((GifFrameBlock)image.getPages()[0]).setFrameTime(200);
image.save(outputPath, new GifOptions() {{ setLoopsCount(4); }});
}