Professional Documents
Culture Documents
Computer Graphics
Rawesak Tanawongsuwan
ccrtw@mahidol.ac.th
3 64
Computer Graphics
• Production and display of still images stored in
digital form
Image
3 66–67
Rendering
• Image is displayed on monitor etc as array of
pixels
• Rectangular (usually square) dots of colour
Bitmapped graphics
3
http://www.prepressure.com/image/bitmapvector.htm
3
Vector graphics
http://www.prepressure.com/image/bitmapvector.htm
http://tds.ic.polyu.edu.hk/_images/duplicate/vector_graphic_decomposition.gif
3 68–69
Memory Requirements
• Bitmapped – any picture of wxh pixels, using c
bytes per pixel occupies whc bytes
299
755
3 68–69
Memory Requirements
• Vector – space required depends on complexity
of picture (how many shapes, segments of
path, etc)
Memory Requirements
• 128 px square with 20px blue outline filled in
red
Image Editing
• Vectors – drawing programs (Illustration, Freehand)
Paint
3
Photoshop
3
Illustrator
3 71
Scaling
• Vectors
• Scaling is a simple mathematical operation on
stored description (before rendering)
• Curves and lines remain smooth at all sizes
• Resolution-independent -- can be scaled to any
size and printed on any output device at any
resolution without losing its detail or clarity
• Good for type and bold graphics that must retain
crisp lines when scaled to various sizes--for
example, logos.
Scaling
• Bitmaps
• Interpolate pixel values
• More or less sophisticated algorithm
• Usually produces loss of quality, blurring, jaggedness
• Resolution dependent -- that is, they represent a fixed
number of pixels
• Appear jagged and lose detail if they are scaled on-
screen or if they are printed at a higher resolution than
they were created for.
3 73–75
• Trace bitmaps
• Difficult and can only produce an
approximation (parameterized)
http://iit.bloomu.edu/vthc/Photoshop/BLENDING/selectiontools.htm
3
http://www.creativepro.com/story/feature/22490.html
http://www.creativemac.com/2003/11_nov/features/download51031103.htm
3 75–78
Layers
• Organizational device used in both sorts of
graphics, especially useful in bitmaps
• Permits separation and manipulation of
different parts of a bitmapped image
• Digital version of clear sheets of acetate,
stacked on top of each other
• Areas without coloured pixels/graphic
objects are transparent so lower layers
show through
• Compositing – combine layers using different
blending modes (digital collage)
3
• This mountain lake photo with the hot air balloon demonstrates a number of the
different blending modes that Layers offers. There are ten different layers in this
image each using a different blend mode, all with the same hot air balloon photo
(which was outlined with one pixel feathering, copied and pasted into different layers
over the background image). Starting at the top left and going across the top to the
right, these layer blend modes are: Normal, Multiply, Hard Light, Darken and
Difference, all used with 100% opacity. Along the bottom in the "reflected" image of
the balloon, going from left to right, the modes used are: Screen, Overlay, Soft Light,
Lighten and Exclusion (also all at 100% opacity). This image demostrates ten of the
seventeen Layer Blending modes available in Photoshop
http://www.carlvolk.com/photoshop15.htm
3
http://www.carlvolk.com/photoshop15.htm
3
• 1-bit images
1-bit Images
• Each pixel is stored as a single bit (0 or 1)
monochrome image
RGB components
RED
GREEN BLUE
3
File formats
• P3
• 44
• 15
• 0 0 0 0 0 0 0 0 0 15 0 15
• 0 0 0 0 15 7 0 0 0 0 0 0
• 0 0 0 0 0 0 0 15 7 0 0 0
• 15 0 15 0 0 0 0 0 0 0 0 0
3 78–79
File Formats
• Many different graphics file formats in existence
Examples of 2D bitmap
specifications
http://www.dcs.ed.ac.uk/home/mxr/gfx/
3 79–80
• Best suited for images with few distinctive colors (e.g., graphics or
drawing)
• Require a license fee to be paid for any program that implements GIF
compression or decompression
3
PS
• Postscript is an important language for typesetting, and many
high-end printers have a Postscript interpreter built into them
Other formats
• Microsoft Windows: WMF: the native vector file format for the
Microsoft Windows operating environment
Animated GIF
3 81–82
Vector Formats
• SVG (Scalable Vector Graphics)
• SWF (Flash)