150 likes | 324 Views
Still-image compression Moving-image compression and File types. “Moving” images. Moving images are an illusion ...... If can project still images at around 50 images per second then most people perceive smooth motion. Cine-cameras actually only capture 24 images.
E N D
Still-image compressionMoving-image compressionand File types
“Moving” images Moving images are an illusion ...... • If can project still images at around 50 images per second then most people perceive smooth motion. • Cine-cameras actually only capture 24 images. • Cine-projectors display black image between each of these 24 • People’s brains perceive this as 48 frames per second Click image to view
118 Screen resolution • Some types of bitmap image (eg BMP): • Each pixel displayed on one pixel of monitor (best quality) • But high-resolution screens (eg 1800 dots across screen) • display picture smaller than low-res (720)
Changing resolutions • Image sent as 5 pixels / mm (!) • Screen can only display 4 pixels / mm • Display must interpolate (calculate) what colours to display • May need to display colours not actually in original image. ? ?
Compression Full-screen images are very big 1024 x 768 image @ 3 bytes per pixel = 2.3 Mbytes 1024 x 768 image @ 3 bytes (RGB) per pixel = 2.3 Mbytes = around 10 minutes to download on dial-up line 1024 x 768 image @ 3 bytes per pixel (for colour) 1024 x 768 image Compression is "squeezing" the file size, often to 1/20th of its original size, without destroying too much of the image
Lossless Compression • Lossless: Compression data is coded more efficiently, none is discarded • Run-length encoding (RLE) • Dictionary-code schemes
Lossless Compression • Method 1 - Used by PGN photos • "short code method" 111 In a photo: if RED most common then red = shortest code if BLUE most common then blue = shortest code 0111 10111 1101101111 0101101110111 • But PNG must store (and transmit) code table with image data
Lossless Compression Method 2 - Used by JPEG RLE: Run Length Encoding - Record run-lengths of same-coloured values 39 3 12 4 11 2 1 2 6 * (14 2 )11 7 9 7 36
Lossy Compression : JPEG • Get big speed-up by working with blocks of 8 x 8 pixels. • So, for each 8 x 8 block, find • what 'pattern' is the nearest match • what main colour or 2 colours of the pattern are • JPG uses approx 4 codes per 64 pixels : ____ % saving! • Can run-length encode the sequence of blocks ~ even further savings!
Moving image compression frame 1 frame 2 (uncompressed) frame 3 (uncompressed) (Uncompressed) (compressed) Need only send the bits of the images that change
Types of video format • .MOV • .MPEG 1 : CD quality • 2 : DVD quality • 4 : many settings • .WMV • .3PG
118 Screen resolution • Some types of bitmap image (eg BMP): • Each pixel displayed on one pixel of monitor (best quality) • But high-resolution screens (eg 1800 dots across screen) • display picture smaller than low-res (720)
Changing resolutions • Image sent as 5 pixels / mm (!) • Screen can only display 4 pixels / mm • Display must interpolate (calculate) what colours to display • May need to display colours not actually in original image. ? ?
Summary • Bitmap (Rastors) based on storing pixels of image • Uncompressed huge • Problem of resolutions • Compression : • Lossless: can achieve some filesize reduction • Lossy: can achieve huge reductions, without • too noticeable changes in quality of image