Source format: 24-bit BMP Destination format: Uncompressed GIF
Limitations:
- Converts only those images whose number of distinct colours doesn't exceed 128.
- Converts only those images whose width is a multiple of 4.
There are three important .c files here:
-
bmp.c :- This file reads in the essential details of a bmp image, including the pixels' colour data.
-
gif.c :- This file stores the pixels' colors into a global colour table, which is then used for writing colour data of pixels into a GIF file. It also writes in essential details required for defining the GIF file.
-
main.c :- This file calls functions new_BMP and new_GIF.
Other files are:
- format.h is the header file containing the structs of BMP and GIF, function prototypes and includes some standard .h files .
- makefile is for code compilation.
Commands for running the file:
- $ make my_project :- For making the OUT file
- $ ./my_project "source_image_name".bmp "output_image_name".gif :- For getting the image output
- $ make clean :- For removing the .o files
CODE INSPIRED BY: