Skip to main content
gifted_reality16B6
Participant
December 24, 2020
Question

How do you reduce the file size (not dimensions) of an animated .gif?

  • December 24, 2020
  • 2 replies
  • 1446 views

What is the best way to reduce the file size of an animated .gif? I have created a 72 frame animation. Although my .gif document is only 72 dpi and 600 x 451 pixels, when I File > Export > Save for web (as a .gif) the file is 20 MB. Too large to email or post to my blog. Do you have a solution that you would like to share?

This topic has been closed for replies.

2 replies

davescm
Community Expert
Community Expert
December 24, 2020

Try :

1. Reducing the frame rate which in turn will reduce the frames required.

2. Reducing the colours or changing from perceptual

3. Try a 3rd party optimisation tool.

Dave

 

gifted_reality16B6
Participant
December 24, 2020

Dave,

Thank you for taking time out to aswer my query. Although I did try all of these options, I was only able to cut the file size from 20 MB to 9 MB. I really appreciate the response. The strange thing is that an MP4 export is only 4MB.

gifted_reality16B6
Participant
December 24, 2020

Nothing strange about that: GIF is an old-fashioned and rather unoptimized non-lossy compression algorithm not meant for optimized video/animation compression.

 

(not my text:):

An animated GIF is a very bad compression format for a few reasons. First of all GIF uses LZW (which was defined in 1984), which is not a good compression format for lossless compression (deflate used by Zip is better and newer formats are even better than that), second GIF only uses 8 bit paletted images (up to 256 indexed colours), so the necessary quantisation usually introduces noise that makes compress worse. Third and that is the main reason, GIF is not a movie compression format at all, it stores the differences between consecutive image but does that in a lossless manner, which is not useful for movies.

GIF inherently compresses less than “lossy” DCT compression as in MPEG. Furthermore, each frame in a GIF animation is independent of all the other frames. In MPEG. Generally and MPEG stream has I-Frames that encodes the entire frame and P-Frames that are encodes from the previous frame.

MP4 or other video formats give a much smaller file while the image quality is better than animated GIF.

 

(my text:)

Also, all browsers now support Animate PNG files. If transparency is required, APNG is much preferred now: 1) better non-lossy compression compared to GIF, 2) full alpha transparency of 256 values (GIF only supports 1bit transparency - either on or of), 3) support for more than 256 colours.


You have given me a lot to think about here. Thanks for taking the time to explain that in such depth.

Derek Cross
Community Expert
Community Expert
December 24, 2020

Experiment with reducing the number of colours from 256 to fewer.