ImageEn, unit iexBitmaps

IEOptimizeGIF


Declaration

procedure IEOptimizeGIF(const InputFile, OutputFile: WideString);


Description

Optimizes a GIF animation (or multi-page GIF) by detecting differences between each frame and removing any data that is duplicated. The resulting file will only include differences between frames and can be significantly smaller.

Note: You can specify the same filename for both InputFile and OutputFile


Demo

Demo  Demos\ImageEditing\AnimatedGIF\AnimatedGIF.dpr


Examples

ImageEnMView1.MIO.SaveToFile('D:\temp.gif');
IEOptimizeGIF('D:\temp.gif', 'D:\output.gif');

// Create an animated GIF file from ten source images
mbmp := TIEMultiBitmap.create;
for i := 0 to 9 do
begin
  mbmp.AppendImage( format( 'D:\Source\Frame %d.bmp', [i] ));
  mbmp.Params[i].GIF_DelayTime := 10; // Display each frame for 1/10th of a second
end;
mbmp.Write( 'D:\animated.gif' );
mbmp.Free;
IEOptimizeGIF( 'D:\animated.gif', 'D:\animated.gif' );


See Also

- CheckAniGIF
- DeleteGifIm
- EnumGifIm (Image Count)
- Global Image Methods
- SaveToFileGIF
- SaveToStreamGIF
- ReplaceFileGIF
- InsertToFileGIF