GIF (Graphics Interchange Format) is not a data compression method. The original version of GIF is known as GIF87a. It is graphical image format that uses variant of LZW to compress the graphical data and allows to send image between different computers. It scans the image row by row and discovers pixel correlated within row not between rows. GIF uses growing and dynamic dictionary for compressing data.
- It takes number of bits per pixel b as parameter. For monochromatic image b=2 and for image with 256 colors or shades b=8.
- It uses dictionary with 2^(b+1) entries. At each fill up dictionary will be in double in size until 4096 entries and remain as static.
- At this point, encoder monitors the compression ratio and may decide to discard dictionary and start with new and empty one.
- At the time of taking decisions on discard, Encoder emits 2^b value as clear code which is sign for decoder to discard the dictionary.
Pointer get longer one byte from dictionary to dictionary and output are in block of 8 bytes. Each pointer preceded by header of 255 bytes maximum and terminates by bytes of 8 zeros. Pointer stores with LSB(Least Significant Bit) on left. Last block contains of value which is 2^(b+1).
GIF compression is inefficient because GIF is in one dimensional while image is in two dimensional. So, GIF is not used by today’s web browsers.
- Project Idea | (Model based Image Compression of Medical Images)
- Arithmetic Operations on Images using OpenCV | Set-2 (Bitwise Operations on Binary Images)
- Difference between PNG and GIF
- Difference between JPEG and GIF
- Image Compression using Huffman Coding
- Image compression using K-means clustering
- JBIG2 compression
- Process Of JPEG Data compression
- What is Image Compression?
- Working with Images in Python
- Erosion and Dilation of images using OpenCV in python
- Stitching input images (panorama) using OpenCV with C++
- Image Processing in Java | Set 14 ( Comparison of two images )
- Addition and Blending of images using OpenCV in Python
- Filtering Images based on size attributes in Python
- Reading images in Python
- Extract images from video in Python
- Python | Denoising of colored images using opencv
- Arithmetic Operations on Images using OpenCV | Set-1 (Addition and Subtraction)
- Python | Create video using multiple images using OpenCV
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.