Comparison of two visualization modes: GIF and mp4

Figure 1.Cardia Image
Figure 2.Cardia Video
GIF-Graphics Interchange Format MP4-MPEG-4 AVC (Advanced Video Coding)
Is a bitmap image format. Is a digital multimedia container format most commonly used to store video and audio.Also used to store other data such as subtitles and still images.
An animated GIF stores each frame as a GIF image, which uses a lossless compression algorithm. An MP4 video stores each key frame (more on that later) as a JPEG image, which uses a lossy image compression algorithm.
GIF cannot contain audio. MP4 can contain audio.
GIFs are larger in file size when dealing with bigger resolutions and longer durations. MP4 are not larger in file size when dealing with bigger resolutions and longer durations.
Any browser this century can natively support GIFs. HTML5 is needed to natively support MP4
GIFs use a reduced 256 color palette, which makes GIFs look more grainy on realistic images MP4 doesnot have that property.
Algorithm

  1. Load cardia.mat file using load command.
  2. Convert 3-D image to 2-D image using
    • V1=V1(:,:);
  3. Convert int16 to Unit8 using command
    • Unit8(V1);
  4. Output the image using imwrite();
  5. Read the image using imread();
  6. Given image to splitted into individual frame by following steps:
    • [w,l]=size(I);
    • s=l/30;
    • for i=0:29
    • n = I(:, 1 : end/30+i);
    • for j=1:w
    • for k=1:s
    • n(j,k)=I(j,k);
    • end
    • end
    • end
  7. 30 images are then added with 90 more images to make GIf more smooth.
  8. Then convert the GIF image to MP4 file.
Copyright © 2018 Anita Maya Rai. All rights reserved.