si23 introduction to computer graphics l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
SI23 Introduction to Computer Graphics PowerPoint Presentation
Download Presentation
SI23 Introduction to Computer Graphics

Loading in 2 Seconds...

play fullscreen
1 / 30

SI23 Introduction to Computer Graphics - PowerPoint PPT Presentation


  • 254 Views
  • Uploaded on

SI23 Introduction to Computer Graphics Lecture 2 - Images Graphics Programming 3D Graphics URL VRML viewer 2D vector graphics surfaces Image Display URL SVG Viewer lines, areas URL GIMP viewing, shading graphics algorithms colour interaction Course Outline OpenGL API

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'SI23 Introduction to Computer Graphics' - emily


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
course outline

Graphics

Programming

3D

Graphics

URL

VRML

viewer

2D vector

graphics

surfaces

Image

Display

URL

SVG

Viewer

lines,

areas

URL

GIMP

viewing, shading

graphics

algorithms

colour

interaction

Course Outline

OpenGL

API

animation

course outline images and colour

Image

Display

URL

Course Outline – Images and Colour
  • Image creation, manipulation and display
  • Colour

GIMP

colour

graphics display hardware cathode ray tube
Graphics Display Hardware -Cathode Ray Tube

Basic technology for

workstation screens is the

cathode ray tube

phosphor

coated

screen

heated cathode

electron beam

focus

deflection

plates

Beam scans across

screen in series

of lines

- 60 times per second

colour raster scan display

blue

green

red

metal mask

Colour Raster Scan Display
  • Colour CRT

Colour composed as

combination of RED, GREEN, BLUE

colour frame buffers

Today most colour displays

have 24bit frame buffers

or pixmaps.

So each pixel has a 24bit

colour value associated

with it - 8 bits for R,G,B.

0

1

1

1

0

1

1

01101101 11011001 10011100

red gun

green gun

blue gun

Colour Frame Buffers
colour look up table clut colour palette
Colour Look Up Table (CLUT)Colour Palette

To save on memory costs, some displays use a look-up table …

8-bit frame buffer

1 0 1 0 0 1 1 1

Pixel value (=167)

.

.

.

.

.

.

.

.

167

24-bit colour table

11001100 10110110 11011100

.

.

.

.

.

.

.

.

red green blue

Pixel value acts as an index into the look up table. This

allows 256 (=28) on-screen colours from a palette of 16.7 million

gamma correction
Gamma Correction
  • For CRT displays, brightness is not a linear function of the drive signal
  • Instead it is related by:

Brightness = (Signal)g

  • Typical value for g is 2.2
  • Thus displays will provide ‘gamma correction’ of the red, green and blue signals to give the expected uniform effect

Note: assumes signal in range [0,1]

homework
Homework
  • How does colour work for LCD displays??
images
We can generate images in a variety of ways…

… and we can subsequently process them in order to …

The GIMP will help us do many of these things

Fill in the answers!

Images
image formats
Large number of formats have emerged over the years

Why?

Which are in common use?

Use a couple of test pictures

Image Formats
silicon graphics rgb format
Silicon Graphics RGB Format
  • File begins with a header which has the following information:
    • xsize, ysize - dimensions of image
    • zsize : 1 for 8-bit (colour index); 3 for 24-bit colour
    • colour map flag: indicates image or colour map
  • The rest of the file contains the data
    • for 8-bit, each pixel represented as 1 byte, so there are ysize scan lines, each of xsize bytes
    • for colour, three single images (for R, G, B) are stored, one after the other.
image sizes
The picture of Bank’s Peninsula is 2472 by 1704 pixels

as RGB image it is 12 Mbytes

The diagram with the square is 256 by 256 pixels

As RGB image it is 193k bytes

Image Sizes
compression rle
Compression - RLE

Consider the triangle

on right.

Suppose 0 represents

black and 1 represents

white.

The image file will look like, for each scan line:

000000000000111111111111110000000000

It would be more efficient to store as ‘runs’ of pixel values:

12*0,14*1,10*0

This is known as Run Length Encoding (RLE)

and is an option in the RGB image file specification.

rle compression
The NZ photo reduces from 12 Mbytes to 9.5 with RLE compression

Is this what you’d expect?

The square reduces from 193k to 13k with RLE compression

Is this what you’d expect?

RLE Compression
image formats16
Image Formats
  • RGB is one of a large number of image formats
    • MS Windows bitmap for PC applications (BMP format)
    • GIF, JPEG, PNG are widely used across different platforms
  • RLE is just one of a number of compression techniques - different formats use different compression methods
image formats gif
Image Formats - GIF
  • GIF (Graphics Interchange Format)
    • probably the most common image format
    • developed by CompuServe Inc
    • 8 bit colour indices point to entries in a colour table of size 256
    • thus in uncompressed form, we have header comprising colour table, followed by rows of data, one byte per pixel
    • rows stored as 0,8,16,..; 4,12,20,..; 2,6,10,..; 1,3,5,... this interlacing gives progressive image display
    • 24 bit colour images not supported
    • Animated GIFs a very useful feature (used with care)
lzw compression
LZW Compression
  • GIF uses the LZW (Lempel-Ziv-Welch) compression technique which has been subject of frequent legal battles -UNISYS and CompuServe claim to have patented it (so not supported fully in Windows GIMP)
  • Dictionary-based
    • frequently occurring patterns of data are identified and given code words which are shorter than the original pattern
  • For normal images, typically better than RLE; not good on noisy images (neither is RLE)
  • For file size comparison, see PNG later
image formats png
PNG = Portable Network Graphics

Created as a successor to GIF, free of legal restrictions

Defined as a Web standard by W3C

.. And better than GIFs!

Key features:

Transparency

Gamma correction

Text

Interlacing

Filtering

Compression

Image Formats - PNG
png features
Transparency

Alpha channel in addition to RGB

Gamma Correction

Store the gamma value at creation

Correct at display time

Can you work out the correction formula?

PNG Features
png features21
Text

Why would it be useful to associate text with an image?

Interlacing

2d interlacing

7 passes (Adam7)

Why is this useful?

PNG Features
png features22
Filtering

Simple operator to promote good compression

Eg sub filter replaces pixel values on scan line, with differences from predecessor

Compression

Uses LZ77 approach (recall from SI11)

Plus Huffman encoding (also from SI11)

Used in gzip

PNG Features

Encoding is: interlace, filter, compress

example
NZ photo does not compress particularly well

Uncompressed 12 MB

RLE 9.5 MB

PNG 4 MB

Square compresses outstandingly well

Uncompressed 193 kB

RLE 13 kB

PNG 1 kB

Example
image formats jpeg file interchange format jfif
Image Formats - JPEG File Interchange Format (JFIF)
  • Developed as an international standard interchange format using a compression method developed by Joint Photographic Experts Group (JPEG)
  • Supports 24 bit colour, or greyscale – but not palette
  • Copes with noisy data, so can handle scanned images
jpeg compression
JPEG Compression
  • Discrete Cosine Transform (DCT) applied to 8x8 subblocks of image
    • DCT transforms data values to a new set of 64 data items (in a frequency space)
    • ordered in importance (1st value represents average over subblock, etc, values at end represent high frequency, ie noise)
    • ‘safe’ to discard these noise terms and store only the early terms from the DCT
jpeg compression26
JPEG Compression
  • Resulting values are then compressed using Huffman encoding
  • Free of any legal problems
  • Known as lossy compression, because we cannot recreate exact original image (cf RLE and LZW which are lossless)
jpeg quality control
JPEG Quality Control
  • JPEG allows user to tune the quality of encoding by a ‘quality setting’
    • corresponds to ignoring values in the DCT
    • Q-factor from 0 to 100 (100 = high quality)
  • Suggested technique:
    • encode using Q factor of 75%, decode and redisplay
    • if defects seen, increase Q and re-encode
    • if acceptable, decrease Q until just acceptable
image transfer across www summary
Image Transfer across WWW- Summary
  • GIF format still predominates 
    • lossless, 8-bit palette-based, LZW compression, legal status in doubt, supported by all browsers
  • PNG
    • lossless, 8-bit palette or 24 bit colour, non-patented compression, transparency, gamma correction, 2d interlacing, filtering
  • JPEG
    • lossy, 24-bit, non-patented compression
  • Choice:
    • PNG for synthetic images
    • JPEG for photographic images
reading more
Reading More
  • The source of PNG information
    • http://www.w3.org/Graphics/PNG/
  • Test your browser support for PNG transparency
    • http://trific.ath.cx/web/png/
  • What is difference between GIF87a and GIF89a?