graphics/image data types the number of file formats used in multimedia continues to proliferate....

32
Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats used in the popular product Macromedia Director. Table 1: Macromedia Director File Formats

Upload: griffin-nichols

Post on 28-Dec-2015

260 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Graphics/Image Data TypesThe number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats used in the popular product Macromedia Director.

Table 1: Macromedia Director File Formats

Page 2: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Overview of Image Properties

• An image is composed of an array of dots, more commonly referred to as pixels (short for picture elements). One generally refers to a computer image's dimensions in terms of pixels; this is also often (though slightly imprecisely) known as its resolution. Some common image sizes are 640 × 480, 800 × 600, and 1024 × 768 pixels, which also happen to be common dimensions for computer displays.

Page 3: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

• In addition to horizontal and vertical dimensions, an image is characterized by depth. The deeper the image, the more colors (or shades of gray) it can have. Pixel depths are measured in bits, the tiniest units of computer storage;

- a 1-bit image can represent two colors (often, though not necessarily, black and white).

- a 2-bit image four colors. - an 8-bit image 256 colors, and so on.

Page 4: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

• To calculate the raw size of the image data before any compression takes place, one needs only to know that 8 bits make a byte.

• Thus a 320 × 240, 24-bit image has 76,800 pixels, each of which is 3 bytes deep, so its total uncompressed size is 230,400 bytes.

Page 5: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

1-bit Images

Each pixel is stored as a single bit (0 or 1), so also referred to as binary image.

Such an image is also called a 1-bit monochrome image since it contains no color.

Next Figure shows a 1-bit monochrome image (called “Lena“ by multimedia scientists - this is a standard image used to illustrate many algorithms).

Page 6: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats
Page 7: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

8-bit Gray-level Images Each pixel has a gray-value between 0 and 255. Each

pixel is represented by a single byte; e.g., a dark pixel might have a value of 10, and a bright one might be 230.

Bitmap: The two-dimensional array of pixel values that represents the graphics/image data.

Image resolution: refers to the number of pixels in a digital image (higher resolution always yields better quality).

- Fairly high resolution for such an image might be 1600 * 1200, whereas lower resolution might be 640 * 480.

Page 8: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Frame Buffer

Page 9: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Multimedia Presentation

Each pixel is usually stored as a byte (a value between 0 to 255), so a 640 × 480 grayscale image requires 300 kB of storage (640 × 480 = 307, 200).

Next Fig shows the Lena image again, but this time in grayscale.

Page 10: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats
Page 11: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Dithering

• which is a means of mixing pixels of the available colors together to give the appearance of other colors (though generally at the cost of some sharpness) .

• When an image is printed, the basic strategy of dithering is used, which trades intensity resolution for spatial resolution to provide ability to print multi-level images on 2-level (1-bit) printers.

Page 12: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

An ordered dither consists of turning on the

printer output bit for a pixel if the intensity level is greater than the particular matrix element just at that pixel position.

Next Fig. (a) shows a grayscale image of "Lena". The ordered-dither version is shown as (b), with a detail of Lena's right eye in (c).

Page 13: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats
Page 14: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Color Image Data Types

• The most common data types for graphics and image file formats ; 24-bit color and 8-bit color.

• Some formats are restricted to particular hardware/operating system platforms, while others are “cross-platform” formats.

• Even if some formats are not cross-platform, there are conversion applications that will recognize and translate formats from one system to another.

• Most image formats incorporate some variation of compression technique due to the large storage size of image files. Compression techniques can be classified into either lossless or lossy.

Page 15: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

8-bit Color Images Many systems can make use of 8 bits of color

information (the so-called “256 colors”) in producing a screen image.

Such image files use the concept of a lookup table to store color information.- Basically, the image stores not color, but instead

just a set of bytes, each of which is actually an index into a table with 3-byte values that specify the color for a pixel with that lookup table index.

Page 16: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Color Look-up Tables (LUTs)

The idea used in 8-bit color images is to store only the index, or code value, for each pixel. Then, e.g., if a pixel stores the value 25, the meaning is to go to row 25 in a color look-up table (LUT).

Page 17: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats
Page 18: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

24-bit Color Images• In a color 24-bit image, each pixel is represented by

three bytes, usually representing RGB.- This format supports 256* 256* 256 possible

combined colors, or a total of 16,777,216 possible colors.

- However such flexibility does result in a storage penalty: A 640*480 24-bit color image would require 921.6 kB of storage without any compression.

• Full-color photographs may contain an almost infinite range of color values. Dithering is the most common means of reducing the color range of images down to the 256 (or fewer) colors seen in 8-bit GIF images.

Page 19: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Dithering on Color Image

• Dithering is the process of juxtaposing pixels of two colors to create the illusion that a third color is present. A simple example is an image with only black and white in the color palette. By combining black and white pixels in complex patterns a graphics program like Adobe Photoshop can create the illusion of gray values:

Page 20: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Most images are dithered in a diffusion or randomized pattern to diminish the harsh transition from one color to another. But dithering also reduces the overall sharpness of an image, and it often introduces a noticeable grainy pattern in the image. This loss of image detail is especially apparent when full-color photos are dithered down to the 216-color browser-safe palette:

Page 21: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats
Page 22: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

• The same process softens the effect of reducing the number of colors in full-color images:

A full color photograph

Dithered to 256 color

Page 23: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

(a) shows a 24-bit color image of \Lena", and(b) shows the same image reduced to only 5 bitsvia dithering. A detail of the left eye is shown in (c).

Page 24: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Popular File Formats• Need to store and retrieve graphical data in an

efficient and logical way.• Data stored according to specific format

conventions• Formats are immortal - technology evolves,

new formats appear, but the old ones will still be there!

• No one universal format - different formats for different purposes

• You (probably) won’t need to access the formats in detail

Page 25: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

BMP• Standard bitmap storage format for Microsoft

Windows (also supported by some other non-Microsoft applications)

– Never meant to be portable – Nor meant for a data interchange format across

different operating systems• 1 image per file• Uses RLE (run-length encoding) – therefore uses lossless compression – original bitmap did not support compression!• Huge file sizes! – e.g. sample 470x682 photo stored as 40.3K JPG file

is a 963K BMP file

Page 26: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

GIF• Graphics Interchange Format (1987 and 1989 versions) – The format specification says it is to be pronounced

“jif”• Uses a palette of up to 256 colors – not good for photographs, but great for

text/diagrams• Uses LZW compression of the bitmap data – causes copyright problems (Unisys patent)! – reasonably easy to read and decompress• Supports multiple images (animation!!)• 1989 version supports transparency and interlacing – At most one color in the palette may be declared

transparent

Page 27: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

JPEG

Page 28: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

JPEG image with low quality specified by user

Page 29: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

PNG

Page 30: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

TIFF

Page 31: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

Dithering done by the browser

If a reader of your Web site has his or her display monitor set to 256 colors (an increasingly rare occurrence these days), then the Web browser will display images using the 216-color browser-safe color palette. In this situation there is no way to force the browser to display a color outside the browser-safe palette. If any of your photographs, graphic design elements, or background colors use hues outside the browser-safe palette, the Web browser will automatically dither the displayed images into the browser-safe colors.

Page 32: Graphics/Image Data Types The number of file formats used in multimedia continues to proliferate. For example, Table 1 shows a list of some file formats

The effect of using "unsafe" colors for your major graphic elements is that readers with 256-color displays will see a lot of heavily dithered images. This may be acceptable for some visual elements on the page, but if your basic navigation buttons and background graphics are dithered, parts of the page will be hard to read and the overall effect will be amateurish: