digital images art 311 dr. j. r. parker. key concepts #6 - simulation concept of simulation is...

63
Digital Images Art 311 Dr. J. R. Parker

Upload: ethel-hood

Post on 29-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Digital Images

Art 311

Dr. J. R. Parker

Page 2: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Key concepts #6 - Simulation

Concept of simulation is difficult.

A simulation is a functional representation of an object or process (a system).

It has the ability to produce the outputs from a system given a set of inputs, but it does not create he outputs using the same mechanism. It is based on a model of the system.

Page 3: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Key concepts #6 - Simulation

Why do it?

- To get results when the system is not well understood

- To get results when to do the real thing is dangerous

- To get results quickly.

- To allow multiple systems where one is expensive/hard to build.

Page 4: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Key concepts #6 - Simulation

Example?

NASA used simulations.

A computer game is a simulation

In virtual reality of any resolution we need a simulation of the underlying world.

Allows use of AI, 3D graphical models, sounds, interaction with simulated objects.

Page 5: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

Computer images (digital) are stored as a 2D array or grid of values.

The values are, of course, numbers. They are called picture elements, or pixels.

The numbers represent the darkness or lightness, or the color, of the image at that point.

Page 6: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

Pixels are relative values.A value of 5 might be light or dark

depending on the possible range of values, and the protocol.

Protocol: smaller numbers are dark. 0 is darkest (black)

If the largest level is 8, then 5 is middle grey. If the largest is 255, then 5 is almost black.

Page 7: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

Page 9: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

A ‘dead’ pixel.

Page 10: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

Images are digitized from real scenes or photos. It is also called quantization – the conversion of greys into discrete numeric values.

The degree of quantization describes the number of possible levels.

One byte (8 bits) allows 256 levels, from 0 to 255. This is common. 32 is needed for image display.

Page 11: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

16x16 levels 256 levels per row

Page 12: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

This image has 8 distinct levels.

We can see contouring, where distinct regions meet.

Page 13: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

A few levels can convey a lot of information or feeling.

Page 14: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

How are images represented?

How many pixels are in an image is a measure of quality. It is the size of the 2D array (EG 256x256 pixels)

This is often called resolution, but really resolution is about how big a pixel is – what is it’s area in the real world? That is, how small an object can be seen.

Real-world example: how small an object can be seen on Mars from an orbiter?

Page 15: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

25 dpi (ppi) 6 dpi (ppi)

To be really useful we need over 200 dpi

Page 16: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Here is a picture that is 1200 pixels wide by 800 high.

How big do we print/display it?

Page 17: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

At 72 pixels per inch, this image would be 1200/72 = 16.67 inches by 800/72 = 11.11

inches. If we do that we can see the pixels. The resolution

is too low.

That’s why we can’t reasonably project computer images as large as we like – we can perceived the pixels if they are too big.

Page 18: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Looks kind of blurred.

Page 19: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Reasonable quality is 200 ppi.Professional is 300 ppi minimum.

At that resolution, the image would be Width = 1200/300 = 4 inches Height = 800/300 = 2.667 inches

A typical photo is 4x6 – what size do we need?width/300 ppi = 6 -> width = 300 * 6 = 1800 height/300 ppi = 4 -> height = 300 * 4 = 1200

So we need 1800 x 1200 pixels, or 2,160,000 pixels

Page 20: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

We can do this. My cheesy HP camera can give me 7.2 million pixels.

How about an 8x10?

DO THE WORK, FOLKS. You have 2 minutes.

Page 21: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Answer:

300 pixels per inch x 8 inches wide = 2400 pixels

300 pixels per inch x 10 inches wide = 3000 pixels

Total number of pixels = 2400 pixels wide x 3000 pixels high = 7,200,000 pixels

My cheesy camera wins!

Page 22: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Here’s a picture from my HP. 3072x2304

812 KJPEG

Page 23: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

Here’s a picture from my Nikon. 2048x1536

585K

JPEG

Page 24: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Resolution

In defense of the Nikon, it takes pictures on film which are then scanned by the photofinisher.

They could be scanned at a much higher resolution.

The optics are much better too.

Page 25: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Anyway, we now have resolution and quantization, and now should chat about colour.

Colour is stored (represented) how?

… wait for an answer.

Page 26: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Right, the relative intensities of Red, Green, and Blue.

Just like on the TV screen, every pixel is specified as RGB values. Each one is 8 bits (0-255) so it takes 24 bits to store one pixel.

Our 7.2 megapixel image takes 21.6 million bytes to store in memory/on disk.

By the way, why RGB. Is there a physics thing involved, some kind of natural mathematical representation?

Nope.

Page 27: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

It is because our retinas se these three colours. There is essentially a little coloured oil droplet in front of each cone in our retina.

Page 28: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Each animal has different retinal structure, and distinct colours of pigments.

This is a chicken – 2 colors.

Page 29: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Right, the relative intensities of Red, Green, and Blue.

Page 30: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

As artists, you must know something about how colours mix.

EQ red and blue mix to purple

On a computer, we know exactly how much.

Page 31: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Yellow = red + green255.255.128 255.255.64 255.255.32 255.255.0

Magenta = red + blue255.128.255 255.64.255 255.0.255

Cyan = green + blue128.255.255 64.255.255 0.255.255

Page 32: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Changing a color value by one does not make much difference. 128/129 128/119

128/129 128/119

But it depends on the colour. Our eyes aremore sensitive to somecolours than to others.

Page 33: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

http://homepages.ulb.ac.be/~dgonze/INFO/htmlcolors.png

This site shows you the colors as a table.

Page 34: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

There are lots of colours (How many?)

Page 35: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Colours have names. HTML names, for example:

Page 36: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

There are many "neon" colors.

They have a common feature. They contain a chemical substance that absorbs ultraviolet radiation just at shorter wavelengths that visible light (about 400 nm) and re-emit light in the visible range of wavelengths (400-700 nm) [nm = nanometers]. Mixed with other dyes and pigments gives the "dazzling" colors. There are many web sites dealing with "fluorescence"

Can’t render them on a normal screen.

Page 37: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

So, a pixel can be 3 bytes, one for each colour R, G, B.Red = 126 green = 33 blue = 100Stored as a single number: 126 + (256*33) + (65536 * 100)

Why? These are powers of 2.

100 33 126 in hex is 64 21 7EAnd thus in binary: 01100100 00100001 01111110

Page 38: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

In the colour table, the colour ‘chocolate’ was defined as

#D2691E

Which is to sayRED = D2 = 210GREEN = 69 = 105BLUE = 1E = 31

This is one reason we learned Hex – colours are specified using it.

Page 39: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Converting from colour into grey scale is relatively simple.

1. Can average the RGB values.

So chocolate becomes 210 + 105 + 31 = 356

346/3 = 119 as a grey level.

2. Could simply choose R or G or B to represent grey. This is not recommended.

Page 40: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Frequency? Not really usefulFor design and computer stuff.

Page 41: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Use a weighted average. This is useful for specific conversions, like NTSC television images.

grey = 0.213*R + 0.715*G + 0.072*B

NTSC is bad at representing blues.

Page 42: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

There are other ways to represent colour.

HIS or HSV (Hue/Saturation/Intensity)

Hue is the colour

Saturation is degree of colour

Intensity is brightness

Page 43: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Hue goes from 0.0 to 1.0 or 0 to 255

255 is red, and is right next to 0 (circular)

0

Page 44: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Page 45: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

There are some basic rules for design using color that take advantage of the ‘hue circle’

Page 46: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

The high contrast of complementary colors creates a vibrant look especially when used at full saturation. This color scheme must be managed well so it is not jarring. Complementary colors are really bad for text

Page 47: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Analogous color schemes use colors that are next to each other on the color wheel. They create serene and comfortable designs. Choose one color to dominate, a second to support. The third color is used (along with black, white or gray) as an accent.

Page 48: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

ColourA triadic color scheme uses colors that are evenly spaced around the color wheel. Triadic color harmonies tend to be quite vibrant, even with unsaturated versions of your hues. The colors should be carefully balanced - let one color dominate and use the two others for accent.

Page 49: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

ColourThe split-complementary color scheme is a variation of thecomplementary color scheme. In addition to the base color,it uses the two colors adjacent to its complement.

Often a good choice for beginners, because it is difficult to mess up.

Page 50: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Complementary Triad split-complementary

Page 51: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Analogous colours in a web page

Page 52: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Complementary colours in a web page

Page 53: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Colour

Split-complementary colours in a web page

Page 54: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

How are images stored on a computer?

As computer files, containing numbers.

All such files must hold pixel values, and must define the size of the image (rows and columns).

There are other things possible too:

-Number of grey/color levels- identification of instrument and/or photographer- compression

Page 55: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

PNM format.

Can be PBM (black/white) PGM (grey) PPM (colour)

P1 # This is an example bitmap of the letter "J" 6 10 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Page 56: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

PBM format.

P1 # This is an example bitmap of the letter "J" 6 10

0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

HeaderP1 = ASCII, bi-level

# columns

#rows

Pixel values

Page 57: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

This is a good format for sending by mail. We can alsoexamine the image using a text editor.

P1 black/white ascii p4 black/white binaryP2 grey ascii p5 grey binaryP3 colour ascii p6 color binary

P3 3 2 255 255 0 0 0 255 0 0 0 255 255 255 0 255 255 255 0 0 0

Page 58: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

GIF – Graphics Interchange Format (1987)

Interesting from a number of perspectives.

1. The image data is compressed (Using Lempel-Ziv-Welch (LZW) algorithm). This means that the files are smaller, but pixels can’t be accessed directly. The data must be decompressed first.

2. Pixels are not grey or color values. They are indexes into a table of colours. The index is 8 bits. Called a colour map.

Page 59: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

Colour map – a table of colours indexed by an integer. 0 1 2 3 4 5

Pixel colours are given as indices into this table:

0 0 1 1 0 0 1 0 4 4 5 would be:

Page 60: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

The GIF file has all pixels, compressed, and must also Contain the colour map being used. There are 256 colours specified in this map, indexed 0 .. 255

Two gifs need not have the same colour map. Indeed, they might not even have any colors in common.

One special colour in a GIF image can be identified as ‘transparent’ or ‘background’, meaning that is has no colour.Whatever is underneath that colour will be seen through background pixels.

Page 61: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

Left: a GIF with a background colour specified (blue)Centre: the small image pasted over a larger one.Right: How it would look with no transparency.

Page 62: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

JPEG – Joint Photographic Experts group

Is a file format, highly compressed using a lossy algorithm. TheUser can specify the trade off between size and quality.

GIF JPEG

Page 63: Digital Images Art 311 Dr. J. R. Parker. Key concepts #6 - Simulation Concept of simulation is difficult. A simulation is a functional representation

Image Files

Next class – tools.