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)
- JBIG2 compression
- Image Compression using Huffman Coding
- Image compression using K-means clustering
- Process Of JPEG Data compression
- Working with Images in Python
- Reading images in Python
- Apply changes to all the images in given folder - Using Python PIL
- Python | Working with PNG Images using Matplotlib
- Extract images from video in Python
- Python | Grayscaling of Images using OpenCV
- Python - Process images of a video using OpenCV
- Python | OCR on All the Images present in a Folder Simultaneously
- Generating RGBA portable graphic images through C++
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.