Graphics and compression Flashcards
Define pixel
Smallest addressable area of an image
How do you calculate resolution of VDU screen and an image
VDU screen: number of pixels per row*number of pixels per column An image: Number of pixels per inch/centimetre
Define colour depth
Number of bits used to represent a colour of a single pixel
How do you calculate image size
Image size(in bits) = bits per colour * number of pixels
Define metadata
Information about data stored in same file as image data
Including: date, colour depth, location, etc
How do vector graphics work
They are co-ordinates of objects making up pictures stored as mathematical data. Points described relative from origin.
The objects are comprised of paths, can be scaled and group together.
What path features does each vector have
Start and end point coordinates
Length
Thickness
Colour
Two types of compression
Lossless compression and lossy compression
Define lossless compression and lossy compression
Lossless compression: File can be uncompressed, and o.g quality of image can be restored
Lossy compression: Some o.g image quality lost forever. So when decompress you cannot get it back
How does lossy JPEG work
Storing at reduced resolution
Reduced number of shades to one as not noticeable to human eye
How does lossless dictionary-based work
Contains token numbers that represent letters
Example:
Storing “Station nation creation”
tokens: “tion” = 1, “sta”=2, “na”=3, “crea”=4
so can be stored as ‘21 31 41’ which uses less data
How does lossless run length encoding work
RLE (image based) takes account that images have long runs of pixel with same colour. So if 3 or more consecutive of same colour, run of cells is encoded into 2 bytes
Advantages and disadvantages of RLE
Advantages: Algorithm easy to implement and CPU does not require much horsepower
Computer generated colour images give fair compression ratios
Disadvantages: RLE only effective when file has lots of repetitive data
How does RLE work for monochrome data
Always start with number of whites, then alternate between black and white