Basic Computer Notions Graphics

Pixels

At first glance, the word 'Pixels' here seems to have quite well-formed letters with smooth outlines. When we look more , however, we can see the individual ‘pixels’, or picture elements.

Similarly, the image of a camel looks quite smooth when it's small, but is actually very blocky from up .

2-D graphics resolution

No. pixels
horizontally
No. pixels
vertically
No. bits
per pixel
Total no.
Mbits
Telephone1 black & white 96 65 1  
Palm/pocket2 8-bit colour 160 160 8 0.2
16-bit colour 320 240 16 1.2
16-bit colour 640 240 16 2.4
X-ray CT gray-level 512 5128 2
SVGA3 8-bit colour 800 600 8 4
Laser printer4 low-resolution black & white 3300 2550 1 8
Workstation 24-bit colour 1600 120024 46
Digital camera 5 Mpixels 24-bit colour 2560 192024 118
X-ray film gray-level 4000 400012 192
35-mm film 30-bit colour 4000 300030 360
Digital camera 11 Mpixels 36-bit colour 4064 270436 396
Typography5 high-resolution black & white 2800021000 1 588
70-mm film 30-bit colour 6000 460030 830

1 Nokia 7110 is 96×65, Ericsson R320s is 101×65, both include Web browsers.

2 PalmOS-based PDA's have 160×160 screens. The Nokia 9000i telephone-cum-PDA has a 640×200 screen in addition to a small telephone-type screen. WindowsCE-based handheld computers typically have 640×240 screens.

3 CGA = 640×200×1, EGA = 640×350×4, VGA = 640×480×4, XGA = 1024×768.

4 At 300 dpi. Many printers are now 600 dpi or higher.

5 Approx. 11"×8.25" at 2540 dpi, black and white.

1985 prices of computer terminals Prices for computer terminals, from 1985.

Display technology

Cathode-ray tube

LCD

Mechanism of LCD display

Light is generated by a fluorescent backlight then filtered by the liquid-crystal molecules.

Plasma

Mechanism of plasma display

Light is generated by phosphors.

Comparison of plasma with LCD:

Some of these statements may be debatable, especially if you sell one type or the other.

E-paper

One technique is E Ink: microscopic charged black & white particles.

(IEEE Spectrum 44(2): 10-12, 2007 Feb)

Generation of raster-scan images

An image is created on a cathode-ray tube (CRT) by firing electrons at a chemical (the phosphor) on a glass screen. The electron beam is swept back and forth, and top to bottom, in a zigzag pattern.

The phosphor exhibits persistence, so when the screen is refreshed very fast the pixels appear to be illuminated continuously. very fast refresh rate

Refresh rate

How often you need to refresh, to avoid flicker, depends on

Incandescent lights used to flicker with 25 Hz AC power, but not with modern 50 or 60 Hz.

These days it's recommended that computer monitors should be refreshed at 70 Hz or more.
With a million pixels on the screen, that requires very fast electronics!

Generation of straight lines

To generate a straight line from (x1,y1) to (x2,y2)

Generation of horizontal line from (0,0) to (20,0)

Generation of diagonal line from (0,0) to (10,10)

Generation of oblique line from (0,0) to (20,10)

Generation of oblique line from (0,0) to (5,10)

Generation of oblique line from (0,0) to (3,10)

The algorithm doesn't work in this simple form because of the fixed step size.

The algorithm is also computationally expensive because it involves floating-point multiplications and divisions.

This algorithm uses only integer arithmetic, and no multiplications or divisions.
Generating a straight line from (2,2) to (17,8)
and so on ...

Of course, it takes a lot more than one small straight line ...

Graphics primitives


Graphics processing units

GPU's are becoming complex and programmable.
(Haines, E (2006): An introductory tour of interactive rendering. IEEE Computer Graphics and Applications 26(1): 76- 87

Realistic 3-D rendering: occlusion, shading, textures, perspective, etc.

Being used in for non-graphics applications.

Colour combination

Subtractive

Subtractive combination of cyan,
magenta and yellow Used in colour printing: cyan, magenta & yellow primaries.

Additive

Additive combination of red, green
and blue Used in light-emitting displays: red, green & blue primaries.

Colour display

In digital displays, typically 8 bits for each of red, green and blue.

Amount of video memory (MBytes) required for different resolutions:
Resolution 8 bits/pixel
(256)
16 bits/pixel
(65,536)
24 bits/pixel
(‘true colour’)
32 bits/pixel
VGA1 640 × 4800.31 MB0.61 MB0.92 MB1.22
SVGA2 800 × 6000.48 MB0.96 MB1.44 MB1.92
XGA2 1024 × 7680.79 MB1.57 MB2.36 MB3.14
SXGA 1280 × 10241.31 MB2.62 MB3.93 MB5.24
UXGA 1600 × 12001.92 MB3.84 MB5.76 MB7.68
WUXGA 1920 × 12002.30 MB4.61 MB6.91 MB9.22
NTSC TV ≤720 × 480 (240 lines interlaced)
HDTV1280 × 720
1920 × 1080

1The original VGA had only 4 bits at 640×480.

2The original SVGA and XGA had only 8 bits.

In true-colour mode, 24 bits (3 bytes) are stored for every pixel. This gives millions of colours (224 = 16,777,216).

Memory can be saved by storing only 15 bits (2 bytes with 1 bit unused) for every pixel. This gives thousands of colours (215 = 32,768).

Colour palettes

One can save a lot of memory by storing only 8 bits per pixel ...

... using a lookup table, or palette, to convert from 8 bits to 24 bits for each pixel.

The 8-bit value for a particular pixel is used as an address in the palette, and the 24 bits at that location define the red, green and blue values for that pixel.

With 8 bits, or 256 colours:

Colours should be reserved for GUI, or left free for other programmes. Standard palette in Netscape uses only 216 colours.
Microsoft IE standard palette

Microsoft Internet Explorer has a different 216-colour 'standard' palette, just to be different.
Microsoft IE standard palette

To represent a colour which is not in the current palette, one can either choose the nearest colour, or use dithering.
graph-palette
This image actually uses only 41 colours, which are dithered to simulate 256 colours.

Various methods are available for dithering. The three images below were created by converting a 24-bit image to 8 bits with no dithering (i.e., using nearest colour), with ordered dithering, and with error-diffusion dithering, respectively.
Example of no dithering Example of ordered dithering Example of error-diffusion dithering
The two images below show the different patterns produced by ordered dithering and error-diffusion dithering.
Comparison of ordered and error-diffusion dithering

Colour gamut

Sensitivity of
rods and cones

Colour rendition and perception are not really as simple as just combining three primaries.

The eye's sensitivity to colour involves overlapping frequency curves.
CIE chromaticity diagram

The range of perceptible colours is represented in the CIE chromaticity diagram, using a special set of standardized coördinate axes.

(Cf. Eugene Vishnevsky's Introduction to Color)

Using any particular set of primary colours, the gamut of colours which can be rendered is delimited by a triangle.

Some colour printers use more than 3 colours of ink, e.g., CcMmY.

Many colour printers also use a separate ink cartridge for black.

Colour perception also involves a lot of neural processing.

Something white will be perceived as white even under quite different lighting.
Cf. in digital cameras.

Limits to colour invariance.
Hey, Fred - turn on the blue light, the man wants to see a blue suit.

© 1995, E. H. Adelson, MIT, reproduced with permission

Another illusion: The squares marked A and B are the .
Discussion.

Encoding of text and graphics

Character codes

Graphics formats


TIFF format

NewSubfileType
SubfileType
ImageWidth
ImageLength
BitsPerSample
Compression
Uncompressed
CCITT 1D
Group 3 Fax
Group 4 Fax
LZW
JPEG
PackBits
PhotometricInterpretat
WhiteIsZero
BlackIsZero
RGB
RGB Palette
Transparency mask
CMYK
YCbCr
CIELab
Threshholding
CellWidth
CellLength
FillOrder
DocumentName
ImageDescription
Make
Model
StripOffsets
Orientation
SamplesPerPixel
RowsPerStrip
StripByteCounts
MinSampleValue
MaxSampleValue
XResolution
YResolution
PlanarConfiguration
PageName
XPosition
YPosition
FreeOffsets
FreeByteCounts
GrayResponseUnit
GrayResponseCurve
T4Options
T6Options
ResolutionUnit
PageNumber
TransferFunction
Software
DateTime
Artist
HostComputer
Predictor
WhitePoint
PrimaryChromaticities
ColorMap
HalftoneHints
TileWidth
TileLength
TileOffsets
TileByteCounts
InkSet
InkNames
NumberOfInks
DotRange
TargetPrinter
ExtraSamples
SampleFormat
SMinSampleValue
SMaxSampleValue
TransferRange
JPEGProc
JPEGInterchangeFormat
JPEGInterchangeFormatLngth
JPEGRestartInterval
JPEGLosslessPredictors
JPEGPointTransforms
JPEGQTables
JPEGDCTables
JPEGACTables
YCbCrCoefficients
YCbCrSubSampling
YCbCrPositioning
ReferenceBlackWhite
Copyright

The specification (121 pp.) is available from Adobe.

DICOM format

‘The goals of DICOM are to achieve compatibility and to improve workflow efficiency between imaging systems and other information systems in healthcare environments worldwide.’ (ref.)

The specification is available from NEMA:

Common Web formats

Web browsers typically handle GIF, JPEG and PNG files themselves, but usually have to call a helper application to handle TIFF or other files.

Compression

Lossless compression

pink, pink, pink, pink, pink,
pink, pink, pink, pink, pink,
pink, blue, blue, green, green,
green, green, dark green, dark green,
dark green, green, green, green, green,
green, green, green, green, green,
green, green, green, green, green,
green, green, green, green, green,
green, green, green, blue, blue
11
pink
2
blue
4
green
3
dark green
22
green
2
blue

Used for images (including faxes), text, executable files, word-processing files, and digital data in general. E.g.:

Lossy compression

Used for images, video, audio, and analogue data in general. E.g.:

Some compression schemes (e.g., RLE) are better for images with large areas of uniform colour, while others (e.g., JPEG) are better for complex images with a lot of shading.

This sequence of images shows the effects of increasing the JPEG compression parameter from 0 (lossless) to 100:
000 (11 kB)
010
020
030
040
050 (2 kB)
060
070
080
090
100 (1 kB)

One can also apply smoothing to the image. These two images have smoothing parameters of 0 and 100, respectively (with the compression parameter set to zero). Smoothing reduced the file size by about 16%.

Graphics software

GIMP demo

Paint software


Inkscape demo

Draw software


Paint vs. draw
Paint Draw
Manipulate pixels directly Manipulate geometric primitives, e.g., lines, circles, rectangles, splines, text
Edit by erasing and redoing Edit by adjusting primitives
Save as GIF, PNG, JPEG, TIFF, etc. Save in proprietary format†;
export to GIF, PNG, JPEG, TIFF, etc.
Good for editing scanned images, and for drawings requiring control over individual pixels Good for drawings which are likely to be modified or resized
May also use proprietary format for retaining limited information about objects May permit import of images, for tracing and limited manipulation

† Inkscape's file format is SVG, a W3C standard based on XML. It can be viewed directly in some Web browsers. gnuplot hidden-line demo

Also data-plotting software like gnuplot
Blender demo

and 3-D graphics software like Blender

Video

Medical imaging

Principle of tomography

Multiple views

Reconstruction

Levels of detail

Clinical CT
middle-ear ossicles are barely visible

Reconstruction from microCT
glorious detail

Histology
far more detail, but also artefacts

Image segmentation


Image analysis

Logo of 2nd International Workshop on Human Interactive Proofs, 2005
http://www.cse.lehigh.edu/prr/hip2005/

Pattern recognition is easy for humans, hard for computers.

Lowell's canals on Mars
http://curious.astro.cornell.edu/history.php

.


Bacon home page
R. Funnell
Last modified: Tue, 2007 Mar 20 17:33:24