View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

5.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 2.91 KB File ID: #32546 Version: 1.1
image thumbnail




16 Aug 2011 (Updated )

Converts a multiframe image to an animated GIF.

| Watch this File

File Information

This function converts a multiframe image to an animated GIF.
For example, to create an animation from a series of figures, export to a multiframe TIFF file using export_fig (also available on the FEX), then convert to a GIF, as follows:

    for a = 2 .^ (3:6)
       export_fig test.tif -nocrop -append
    im2gif('test.tif', '-delay', 0.5);

This function is now included in the export_fig package:
The version here will not be maintained.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
20 Jan 2014 James

James (view profile)

17 Apr 2013 Oliver Woodford

Shaun: As the error suggests, you are trying to concatenate images of different sizes. I don't get this error. Make sure your figure is not changing size between calls to export_fig() for some reason.

Comment only
17 Apr 2013 Shaun VanWeelden

Oliver, coll idea, but when I run the example I get the following error:

154 A = cat(4, A{:});
Error using cat
Dimensions of matrices being concatenated are not consistent.
Error in im2gif>imread_rgb (line 154)
A = cat(4, A{:});
Error in im2gif>parse_args (line 117)
A = imread_rgb(A);
Error in im2gif (line 44)
[A options] = parse_args(A, varargin{:});

Where in cat(4, A{:}); A is an array of 6-8 images (type uint8), this was in 13a

Comment only
08 Jul 2014 1.1

Updated description to indicate added to export_fig

Contact us