<<

CS404

Computer

Not CS425 in 3 days! Software and Hardware technologies used in a computer system to create, modify, and display still images stored in digital form. Jaye's browser story. Future is hard to predict. New technologies (LCD, Plasma, Laser, ...) Realigy overlay Virtual reality Holographic

© 2004 Ray S. Babcock CS404

Vector Graphics

Tektronix Storage Screen Graphics

© 2004 Ray S. Babcock CS404

Vector Graphics

Image is stored as a mathematical description of a collection of individual lines, curves, and shapes making up the image. Computation takes place during display. Can internally store vector graphics and then convert to bit­mapped graphics before display.

© 2004 Ray S. Babcock CS404

Bitmapped Graphics

© 2004 Ray S. Babcock CS404

Bitmapped Graphics

Image is modeled by an array of pixel values. In memory? Logical Pixels On screen? Physical Pixels By far the most normal hardware display technology currently in use.

© 2004 Ray S. Babcock CS404

Examples

Vector Flower

© 2004 Ray S. Babcock CS404

Vector Poppy

© 2004 Ray S. Babcock CS404

Vector Image Transformations

© 2004 Ray S. Babcock CS404

Transformed Poppy

© 2004 Ray S. Babcock CS404

Outlined Poppy

© 2004 Ray S. Babcock CS404

Bitmapped Flowers

© 2004 Ray S. Babcock CS404

Bitmapped Image Processing

© 2004 Ray S. Babcock CS404

Enlarge vector image

© 2004 Ray S. Babcock CS404

Enlarge bitmapped image

© 2004 Ray S. Babcock CS404

Graphics File Formats

Many Many ­ “Encyclopedia of Graphics File Formats” describes nearly 100. To compress or not to compress. If compress, lossy or lossless. And how about color? Indexed? Full 32 bit? If indexed, which color table to use? Web friendly: GIF, JPEG, PNG Others: TIFF, BMP, TGA

© 2004 Ray S. Babcock CS404

GIF Originally developed by CompuServe. Lossless compression technique LZW. Lempel­Ziv­Welch assigns fixed length code words to variable length sequences of source symbols but requires no a priori knowledge of the probability of occurrence of the symbols to be encoded. Restricted to 256 colors. Major patent problems with regard to LZW. Replacement ­> PNG?

© 2004 Ray S. Babcock CS404

JPEG Joint Photographers Experts Group Lossy compression based on DCT (Discrete Cosine Transform). Transform image to frequency domain and sort components by most important, then throw away least important components. JFIF – JPEG File Interchange Format specifies the compression. SPIFF is that officially endorsed for JPEG. (see www . . org

© 2004 Ray S. Babcock CS404

PNG

Portable Network Graphics (pronounced “ping” ). See www . libpng . org /pub/png/pngintro.html Replacement for GIF. Removes the problem with the patent by using a different compression technique. Not restricted to 256 colors. Supported by most web browsers.

© 2004 Ray S. Babcock CS404

TIFF

Tagged Image File Format Elaborate EXTENSIBLE file format that can sore full color bitmaps using several different compression schemes (including jpeg). Has the concept of a “tag” specifying a set of data related to the image. This allows for extensions to be bypassed if the reader doesn't recognize a tag. Often used where scaling is important.

© 2004 Ray S. Babcock CS404

BMP

BitMaP format. Bitmap format. Platform­dependent. Only supports a simple form of lossless compression. Often stores uncompressed, (read LARGE).

© 2004 Ray S. Babcock CS404

TGA

Truvision Targa & Vista hardware. One of the earliest to support greater than 256 colors. If you convert the pgm files to tga files can read them.

© 2004 Ray S. Babcock CS404

Vector Graphics File Formats

PostScript SVG SWF

© 2004 Ray S. Babcock CS404

PostScript

A programming language with built­in graphics capabilities that allow it to specify the appearance of pages in the form of a program describing how to place graphics elements – paths, shapes, and fills – on a page. I wrote a PostScript program to do the Sierpinski triangle.

© 2004 Ray S. Babcock CS404 A PostScript “program”

%!PS­Adobe­2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: exam1.dvi %%Pages: 10 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips ­o exam1.ps exam1.dvi %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2003.10.08:1009 %%BeginProcSet: texc.pro

© 2004 Ray S. Babcock CS404

%%Page: 1 2 1 1 bop 147 631 a Fd(1.)49 b(\(4)37 b(p)s(oin)m(ts\))g(Using)g(the)h (follo)m(wing)(co)s(de)k(to)f(de\014ne)i(a)e(3D)g(ob)5 b(ject,)39 b(sk)m(etc)m(h)h(the)e(ob)5 b(ject)38 b(on)f(the)272 751 y(axes)c(b)s(elo)m(w.)44 b(Lo)s(cate)32 b(and)h(lab)s(el)e(an)m(y)i (v)m(ertices)h(y)m(ou)f(use)g(on)g(the)g(diagram)d(y)m(ou)k(create.)272 1021 y Fc(GLfloat)53 b(vertices[])h(=)d({)h(0.0,)g(0.0,)h(1.0,)1451 1142 y(0.0,)f(1.0,)h(0.0,)1451 1262 y(1.0,)f(0.0,)h(0.0};)272 1503 y(GLubyte)g(objectIndices[])i(=)d({)f(0,)h(2,)g(1)f(};)426 1743 y(glEnableClientState\(GL_VER)q(TEX_)q(ARRA)q(Y\);)426 1864 y(glVertexPointer\(3,)56 b(GL_FLOAT,)d(0,)f(vertices\);)426 1984 y(/*)f(object)i(*/)426 2105 y(glColor3f\(0.0,0.0,0.0\);)426 2225 y(glDrawElements\(GL_LINE_LOO)q(P,)k(3,)52 b (GL_UNSIGNED_BYTE,)k

© 2004 Ray S. Babcock CS404

EPS

Encapsulated PostScript Applies certain conventions to the use of PostScript to ensure that the images in an EPS file are self­contained so that they can be incorporated in other documents.

© 2004 Ray S. Babcock CS404

3 W C SVG

Scaleable Vector Graphics format Defined in XML. A derivative of PostScript that uses the same imaging model but a fixed repertoire of operations and is thus easier to implement, and more compact for transmission over networks.

© 2004 Ray S. Babcock CS404

SWF

(pronounced “swiff” ) Flash. Ad hoc standard. Used for vector animations.

All these (PostScript, SVG, and SWF) can also support bitmapped graphics as self­contained objects. And many more, see encyclopedia contents.

© 2004 Ray S. Babcock