Tang Tsui San, Ivy F.6B (22)

Computer Application Assignment #1

1.  Describe and compare 4 major graphic formats.

A) JPEG - Joint Photographic Experts Group (*. jpg, *. jpeg )

JPG is the right format for those photo images which must be very small files, for example, for web sites or for email. The JPG file is wonderfully small, often compressed by 90%, or to only 1/10 of the size of the original data, which is very good when modems are involved.

However, this fantastic compression efficiency comes with a high price. JPG uses lossy compression. Some image quality is lost when the JPG data is compressed and saved, and this quality can never be recovered.

JPG modifies the image pixel data (color values) to be more convenient for its compression method. Detail that doesn't compress well can be ignored (removed instead of retained). This allows amazing size reductions on the remainder, but when we open the file and expand the data to access it again, it is no longer the same data as before. This lost data is like lost purity or integrity. It can vary in degree, it can be fairly good, but it is always unrecoverable corruption of the data. This makes JPG be quite different from all the other usual file format choices.

Most other file compression methods are lossless, which means "fully recoverable". Lossless compression always returns the original data, bit-for-bit identical without any question about differences (losses). We are used to saving data to a file, and getting it all back when we next open that file. Our Word and Excel documents, our Quicken data, and any data at all, we cannot imagine NOT getting back exactly the original data. TIF, PNG, GIF, BMP and most other image file formats are lossless too. This integrity requirement does limit efficiency, limiting compression of photo image data to maybe only 10% to 40% reduction in practice (graphics can be smaller).

There are times and places this compromise is an advantage. Web pages and email files need to be very small, to be fast through the modem, and some uses may not need maximum quality. In some cases, we are willing to compromise quality for size, sacrificing for the better good. And this is the purpose of JPG.

JPG normally should not be used for text or graphic images. It blurs the sharp edges too much, and the results are typically poor. TIF, PNG, and GIF are vastly better for line art or graphic images, and these cases (solid colors instead of continuous tones) normally compress to a smaller file than JPG. JPG cannot contain line art or indexed color anyway. JPG requires 8 bit grayscale or 24 bit color. However for continuous tone photo images, as opposed to text or graphics, then files with high JPG Quality (low compression) are normally acceptable for viewing (read-only purposes), and the small file size is extremely desirable for modems.

B) GIF - Graphic Interchange Format (*.gif)

GIF was developed by CompuServe to show images online (in 1987 for 8 bit video boards, before JPG and 24 bit color was in use). GIF uses indexed color, which is limited to a palette of only 256 colors (next page). GIF was a great match for the old 8 bit 256 color video boards, but is inappropriate for today's 24 bit photo images.

GIF is an excellent format for graphics, and this is its purpose today, especially on the web. Graphic images (like logos or dialog boxes) use few colors. Being limited to 256 colors is not important for a 3-color logo. A 16 color GIF is a very small file, much smaller, and more clear than any JPG, and ideal for graphics on the web.

Graphics generally use solid colors instead of graduated shades, which limits their color count drastically, which is ideal for GIF's indexed color. GIF uses lossless LZW compression for relatively small file size, as compared to uncompressed data. GIF files offer optimum compression (smallest files) for solid color graphics, because objects of one exact color compress very efficiently in LZW. The LZW compression is lossless, but of course the conversion to only 256 colors may be a great loss.

JPG is much better for 24 bit photographic images on the web. For those continuous tone images, the JPG file is also very much smaller (although lossy). But for graphics, GIF files will be smaller, and better quality, and (assuming no dithering) pure and clear without JPG artifacts.

If GIF is used for continuous tone photo images, the limited color can be poor, and the 256 color file is quite large as compared to JPG compression, even though it is 8 bit data instead of 24 bits. Photos might typically contain 100,000 different color values, so the image quality of photos is normally rather poor when limited to 256 colors. 24 bit JPG is a much better choice today. The GIF format may not even be offered as a save choice until you have reduced the image to 256 colors or less.

So for graphic art or screen captures or line art, GIF is the format of choice for graphic images on the web. A complex graphics image that may look bad at 16 colors might look very good at say 48 colors (or it may require 256 colors if photo-like). But often 16 colors is fine for graphics, with the significance that the fewer number of colors, the smaller the file, which is extremely important for web pages.

For GIF files, a 24-bit RGB image requires conversion to indexed color. More specifically, this means conversion to 256 colors, or less. Indexed Color can only have 256 colors maximum. There are however selections of different ways to convert to 256 colors.

C) TIFF –Tag Image File Format (*.tif)

TIFF is the format of choice for archiving important images. TIFF is the leading commercial and professional image standard. It is the most universal and most widely supported format across all platforms, Mac, Windows, Unix. Data up to 48 bits is supported.

TIFF supports most color spaces, RGB, CMYK, YCbCr, etc. It is a flexible format with many options. The data contains tags to declare what type of data follows. New types are easy to invent, and this versatility can cause incompatibly, but about any program anywhere will handle the standard TIFF types that we might encounter. TIFF can store data with bytes in either PC or Mac order. This choice improves efficiency (speed), but all major programs today can read TIFF either way, and TIFF files can be exchanged without problem.

Several compression formats are used with TIF. TIF with G3 compression is the universal standard for fax and multi-page line art documents.

TIFF image files optionally use LZW lossless compression. Compression works by recognizing repeated identical strings in the data, and replacing the many instances with one instance, in a way that allows unambiguous decoding without loss. This is fairly intensive work, and any compression method makes files slower to save or open.

LZW is most effective when compressing solid indexed colors (graphics), and is less effective for 24 bit continuous photo images. Featureless areas compress better than detailed areas. LZW is more effective for grayscale images than color. It is often hardly effective at all for 48 bit images (VueScan 48 bit TIF LZW is an exception to this, using an efficient data type that not all others use ).

TIF is great, practical and it's the standard universal format for high quality images, it simply does the best job the best way. Give TIF very major consideration, both for photos and documents, especially for archiving anything where quality is important. But TIF files for photo images are generally pretty large. Uncompressed TIFF files are about the same size in bytes as the image size in memory. 24 bit RGB image data is 3 bytes per pixel. That is simply how large the image data is, and TIF LZW stores it with recoverable full quality in a lossless format (and again, that's a good thing).

There are situations for less serious purposes when the full quality may not always be important or necessary. JPEG files are much smaller, and are suitable for non-archival purposes, like photos for read-only email and web page use, when small file size may be more important than maximum quality. JPG has its important uses, but be aware of the large price in quality that you must pay for the small size of JPG, it is not without cost.

D) PNG – Portable Network Graphics (*.png)

PNG was designed recently, with the experience advantage of knowing all that went before. The original purpose of PNG was to be a royalty-free GIF and LZW replacement. However PNG supports a large set of technical features, including superior lossless compression from LZ77. Compression in PNG is called the ZIP method, and is like the 'deflate" method in PKZIP.

But the big deal is that PNG incorporates special preprocessing filters that can greatly improve the lossless compression efficiency, especially for typical gradient data found in 24 bit photographic images. This filter preprocessing causes PNG to be a little slower than other formats when reading or writing the file .

PNG files may also contain an embedded Gamma value so the image brightness can be viewed properly on both Windows and Macintosh screens. These should be wonderful features, but in many cases these extra features are not implemented properly in many programs, and so these unique features must be ignored for web pages. However, this does not interfere with using the standard features, specifically for the effective and lossless compression. Most image programs support PNG, so basic compatibility is not an issue. You may really like PNG.

PNG is lossless compression, It is well suited for master copy data, and because PNG is a noticeably smaller file than LZW TIF. Perhaps about 25% smaller than TIF LZW for 24 bit files, and perhaps about 10% to 30% smaller than GIF files for indexed data. Different images will have varying compression sizes, but PNG is an excellent replacement for GIF and 24 bit TIFF LZW files.It does define 48 bit files,

2.  Describe and compare 2 major sound formats

A) MIDI (*. midi, *.mid)

MIDI (Musical Instrument Digital Interface) is a standard protocol developed in 1983 to communicate note and effect information between electronic music devices such as instruments, keyboards, synthesisers and computers. The MIDI file will store a number of aspects of the sound, including: the note's pitch, length and volume, as well as additional characteristics such as vibrato and delay time. A MIDI-compatible computer records music as keystroke and control codes, which, when saved as a MIDI file, can be easily manipulated by any other MIDI-compatible device.

Strengths:

The MIDI standard allows for musical pieces to exchanged and edited by different computers on different platforms in a way that conventional digitized sound (actual waveforms) cannot. MIDI produces much smaller file sizes for musical events, compared to other sound formats.

Weaknesses:

Browsers require separate plug-ins or helper applications to play MIDI files.

B) WAV (*.wav)

WAV file format was developed by IBM and Microsoft as the RIFF (Resource Interchange File Format) WAVE to store arbitrary sound data in a structured format. The format has become the de facto standard for storing sound files on Windows machines: an operating system which uses WAV files for basic system sounds. The quality of the sound generated can be either 8-bit or 16-bit, with the higher quality 16-bit files (at 44100 Hz) storing 88Kb of audio data per second.

Strengths:

WAV files are simple and widely used, especially on PCs. Many applications have been developed to play WAV files and it is the native sound format for Windows. Later versions of Netscape Navigator (3+) and Microsoft Internet Explorer (2+) support the WAV format.

Weaknesses:

WAV is seen as a proprietary Windows format, although conversion tools are available to play WAV files on other platforms. WAV files are not highly compressed.

3.  Describe and comparer 2 major video formats

A) MPEG - Moving Picture Experts Group (*. mpeg)

MPEG refers to the family of digital video compression standards and file formats developed by the group. It generally produces better-quality video than competing formats, such as Video for Windows, Indeo and Quick Time .MPEG files can be decoded by special hardware or by software.

MPEG achieves high compression rate by storing only the changes from one frame to another, instead of each entire frame. The video information is then encoded using a technique called DCT. MPEG uses a type of lossy compression, since some data is removed. But the diminishment of data is generally imperceptible to the human eye.

There are three major MPEG standards: MPEG-1, MPEG-2 and MPEG-4.

·  The most common implementations of the MPEG-1 standard provide a video resolution of 352-by-240 at 30 frames per second (fps). This produces video quality slightly below the quality of conventional VCR videos.

·  MPEG-2 offers resolutions of 720x480 and 1280x720 at 60 fps, with full CD-quality audio. This is sufficient for all the major TV standards, including NTSC, and even HDTV. MPEG-2 is used by DVD-ROMs. MPEG-2 can compress a 2 hour video into a few gigabytes. While decompressing an MPEG-2 data stream requires only modest computing power, encoding video in MPEG-2 format requires significantly more processing power.

·  MPEG-4 is a graphics and video compression algorithm standard that is based on MPEG-1 and MPEG-2 and Apple QuickTime technology. Wavelet-based MPEG-4 files are smaller than JPEG or QuickTime files, so they are designed to transmit video and images over a narrower bandwidth and can mix video with text, graphics and 2-D and 3-D animation layers. MPEG-4 was standardized in October 1998 in the ISO/IEC document 14496

B) Audio Video Interleave - AVI