These functions can be used to read and write animated gifs. They are intended for use with 4-D image arrays of various type. Supported types include RGB/RGBA arrays, as well as indexed images. Indexed mages with transparent content can be specified by a corresponding vector of indices, or by simply appending an alpha channel to the image array itself. When writing, colormaps, transparency, and disposal method can be specified per-frame or globally.
.
Optional functionality requires the use of imagemagick and is exclusively intended to work in a *nix environment, but default settings should work on other systems. I have no intention of modifying this to be more robust in that aspect.
.
====================
.
GIFREAD(FILEPATH, {KEYWORDS})
reads all frames of an animated gif into a 4-D image array
.
====================
.
GIFWRITE(INARRAY, {DISPOSALMETHOD}, FILEPATH, {DELAY}, {WRITEMETHOD})
GIFWRITE(INARRAY, MAP, {TRANSPARENTIDX}, {DISPOSALMETHOD}, FILEPATH, {DELAY}, {WRITEMETHOD})
Write image stack to an animated gif
.
These tools are merely a subset of the Matlab Image Manipulation Toolbox (FEX)
https://www.mathworks.com/matlabcentral/fileexchange/53786-image-manipulation-toolbox
DGM (2021). Tools to read and write animated gif files (https://www.mathworks.com/matlabcentral/fileexchange/52514-tools-to-read-and-write-animated-gif-files), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Thank you for your help!!! - Georgy Kukharev
Jack: That sounds reasonable. I've added that to the todo list.
Great gifwrite(). How about having a frame range for gifread() so one can efficiently test methods used on large GIFs, for example?