Graphics Interchange Format
To extract frames from GIF file.
The image is usually an animated GIF file.
The multiframes are read using the syntax: imread(filename, ‘frames’, ‘all’)
To read ‘n’ number of frames from a GIF file: imread(filename, ‘frames’, 1:n)
Here, the GIF image is an animated file and contains 8 frames.
The frames that are read will be stored in a 4-D format.
To animate the muliframes: use ‘immovie’ to make a movie from the muliframe image.
Play the movie using ‘implay’.
To view a particular frame:
imshow(A(:,:,4),map); Here the 4th frame is viewed.
To create avi file from the movie:
movie2avi(mov, 'cute_girl.avi', 'compression', 'None','fps',3);
Here frames per second(fps) is 3.
Tagged Image File Format
In MATLAB, when we try to read some .tiff images. The images will be read in the form of grayscale. This happens when the ‘photometric’ attribute is set as ‘grayscale’ and the ‘samples per pixel’ is 1.
Now, let’s check the metadata of the image:
The photometric value will be 3, which represents the image is grayscale.
The samples per pixel will be 1.
In order to obtain the RGB image in a tiff format, read an image along with its colormap. Then convert the image to rgb using the map. The final image will be a RGB image.
It is the information about the data in the file. The information can be about the file type, date created, image height and width, and image compression type and so on.
A colormap is a m by 3 matrix. Each row defines one RGB color intensities.