JPEG - GIF Conversions
To examine how repeated file format conversion affects the quality of an image.
Storing a photograph on a computer can take a lot of memory. This is the reason why image formats like GIF and JPEG were invented. These formats try to keep what is most important about an image and not worry about the rest. Usually the change would not be this drastic, but for the sake of clarity observe the two images below.
This is the type of thing a compression algorithm for images might do, it would lose some of the details of the picture but in exchange it would make it a much smaller file.
But what if we repeatedly apply such a procedure to a picture, by converting it between two different compression formats? Will the programs only throw away the extra information once, and thereafter the image will remain the same no matter how many times it is converted? Or will the programs keep throwing away more and more information? In that case, do we at least keep getting a smaller and smaller file size?
Will repeated fill format conversion continue to degrade image quality? Will the file size shrink?
- ImageMagick (free image software that can be obtained here.)
- Open up a photograph you like in ImageMagick, and duplicate the original in a new folder named OUTPUT.
- Using ImageMagick, save the photograph as a GIF and call it 1.gif - place it in the same folder.
- Now open the newly-created 1.gif file and save it as 2.jpeg (as a JPEG-formatted image, of course) in the same folder.
- Continue this process, always alternating between the two file formats and increasing the number in the file name.
What happens to the image quality as you continue the above process? Does the file size change?
You could try this with different images. Photographs will respond differently then simple cartoons. Try to research how the jpeg and gif formats work and why different types of images might respond differently. Test your theory. ImageMagick can also be operated from a command line. Can you write a simple program that will automate the conversion process for you? (This is usually referred to as a "batch routine" or "batch job.")