- ECE Home
- Undergraduate Studies
- My Home
- Presentations
- Guidelines
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skip to the content of the web site.We will discuss a number of common errors made by individuals unfamiliar with image formats, including:
Using a PNG to store a photograph has only one significant disadvantage: significantly more memory is required; however, using a GIF will not only require more memory, it will also severely deteriorate the quality of the image.
A graphic usually consists of lines which, by themselves are high frequency: for example, in Figure 1, there is a very sharp transition from black to white.
Figure 1. A graphic saved as a PNG and a zoom on one section.
The Fourier coefficients of such an edge will decay very slowly, and as a consequence, if the higher coefficients are ignored, as is the strategy for JPEG, the result is the very poor approximation in Figure 2.
Figure 2. A graphic stored as a JPEG and a zoom on one section.
To visualize this effect, consider Figure 3 which contains a unit step function and a finite Fourier series approximation. There are two obvious features:
These manifest themselves in a graphic stored as a JPEG as speckles.
Figure 3. The unit step function and a Fourier series approximation.
Another issue is file size. While the JPEG format is excellent at reducing the file size of a photograph, a graphic, in general, is relatively simple. The algorithms used to store a PNG are much more efficient at storing such data. Consequently, the file does not differ greatly. Consider the entries in Table 1 which list the
Format | Quality | File Size | Comments |
---|---|---|---|
PNG | — | 59489 | Original |
JPEG | 100 | 63873 | Virtually identical |
80 | 29705 | Severely affected by artifacts |
Consequently, to attain the same image appearance with JPEG as for PNG, it is necessary to use a quality factor of 100 which results in a larger file than the original PNG.
Because GIF is restricted to 256 24-bit colours, it uses an effect called dithering to approximate a larger number of colours. To view the effect of dithering, consider the original PNG image of a surface plot shown in Figure 4.
Figure 4. A surface plot stored as a PNG.
Figure 5. A surface plot stored as a GIF.
The resolution of an image is fixed when it is saved to disk. It is not possible to zoom a small image and expect to see any amount of detail in the expanded version. Presentation software may attempt to correct some of the artifacts which occur when an image is zoomed, but the result will, never-the-less, be blurry at best.
Figure 6 shows a capture of a 1200×1200 image while Figure 7 shows a screen capture of a 200×200 blown up to the same size.
Figure 6. A 1200×1200 PNG with a focus on one section.
Figure 6. A 200×200 PNG zoomed with a focus on one section.