1 / 29

Topic 2 Bitmapped Graphic Data

Topic 2 Bitmapped Graphic Data. Hardware – CCD. Charge-Coupled Device (CCD) A CCD is a device containing grids of pixels that are used in scanners, digital cameras and digital video cameras as light-sensing devices. Bitmapped Graphic Data. Hardware – CCD.

waylon
Download Presentation

Topic 2 Bitmapped Graphic Data

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 2 Bitmapped Graphic Data

  2. Hardware – CCD Charge-Coupled Device (CCD) A CCD is a device containing grids of pixels that are used in scanners, digital cameras and digital video cameras as light-sensing devices. Bitmapped Graphic Data

  3. Hardware – CCD An image is projected by a lens onto a 2D rectangular array of CCD image sensors causing each sensor to store light that representing the image. Bitmapped Graphic Data Each sensor stores the light for a single pixel so the more CCDs the higher the resolution of the image. An ADC is used to convert the signal to digital and a binary value for each CCD sensor is stored.

  4. Hardware – Digital Camera • Digital cameras • Have a 2D rectangular array of CCD sensors to capture the image • Each sensor captures the light for a single pixel (roughly) • Therefore the more CCDs the higher the resolution of the image • The CCD converts the light into an electrical signal i.e. a voltage • An ADC is used to convert the signal to a digital signal • Now the image can be stored on the computer in digital form Bitmapped Graphic Data

  5. Image Lens CCD ADC Storage Capturing photo-images/video Sequence of events 1 Select IMAGE 2 Image is directed through LENS 3 Light attracted to CCD sensors Bitmapped Graphic Data 4 Pass analogue signal through ADC chip DSP 5 Apply signal processing via DSP 6 Store on backing storage

  6. Hardware – Scanner • Scanner • Hard copy of image is scanned • Light is reflected onto light-sensitive diodes that translate the light into a voltage • An ADC converter translates each voltage into a digital pixel • Pixel data is transferred to a software application the data can be read from Bitmapped Graphic Data

  7. Role of ADC When an electrical signal is received from the CCD it needs to be converted to a digital signal by an Analogue to Digital Converter chip. Bitmapped Graphic Data

  8. Number of colours = 2 bit depth Storage of graphic data Bitmaps The entire image is stored as an ordered map of binary codes that represent the individual colour of each pixel. The size of each binary value is known as the colour (bit) depth. We can easily work out how many colours can be represented: Bitmapped Graphic Data Examples Bit depth is 1 bit: 21 => 2x1 = 2 colours Bit depth is 2 bits: 22 => 2x2 = 4 colours Bit depth is 3 bits: 23 => 2x2x2 = 8 colours … Bit depth is 8 bits: 28 = 2x2x2x2x2x2x2x2 = 256 colours So, a bitmap that has 16 colours means a bit depth of 4 bits!

  9. Storage of graphic data Indexed Colour Colours available are indexed in an array that acts as a ‘palette’ of available colours - known as a Colour Lookup Table (CLUT). Each pixel stores the index to the array (palette) for the colour shade required rather than the actual binary colour code. These tables typically store 4, 16, or 256 distinct colours. Bitmapped Graphic Data Advantage: Indexed Colour reduces file/memory size and transfer times. Disadvantage: Limited number of distinct colours.

  10. Storage of graphic data Indexed Colour Examples 16 colours 4 colours Bitmapped Graphic Data 256 colours 24 bits

  11. Red 0-255 Blue 0-255 Green 0-255 Storage of graphic data 24-bit Bitmap A set of 3 bytes (24 bits) represents the colour of each pixel, known as the RGB Colour Code. Each pixel actually consists of three smaller dots – one for each of the primary colours, which in electronics are Red, Green and Blue. Bitmapped Graphic Data In 24-bit colour each of the primary colours has a byte (8 bits) allocated to store the colour shade so there are 16, 777, 216 possible shades. Note: A colour lookup table is not needed as the bitmap stores the actual 24-bit colour code.

  12. Storage of graphic data Bitmapped Graphic Data

  13. Hexadecimal and colour codes Extension Hex is a base 16 numbering system commonly used to represent RGB colour codes to reduce the number of digits to be worked with. Hex uses the digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Where A = 10, B =11, C = 12, D = 13, E = 14 and F = 15. This example hex colour code #9900CC means the RGB mix for this shade is: Red– 99 Green – 00Blue - CC Bitmapped Graphic Data And this converts nicely into binary and into decimal…..

  14. Hexadecimal and colour codes Extension In a Windows application you can enter the decimal values for Red, Green and Blue to customise and mix the colour shade you require. Bitmapped Graphic Data Always remember though that the colour code will always be stored by the computer system as a 24-bit binary code!

  15. Storage of graphic data Run Length Encoding (RLE) RLE is a simple lossless data compression algorithm. Sequences of repeating data (runs) are stored as a count and a single data value. Example: Before RLE: aaaaaaaaaabbaaaaaabbaaaaaaaaaabbaaaaaabb After RLE: 10a2b6a2b10a2b6a2b So original 40 characters reduced to 18 characters! RLE and bitmaps RLE can be applied to bitmaps to reduce file size. It works best where there are solid blocks of colour and a count is made of the number of pixels in the run with the same colour code. The length of each run is held in 1 byte so the maximum size of a run of colour is 255 repetitions. Bitmapped Graphic Data

  16. RLE algorithm Storage of graphic data Example – RLE and Bitmaps A run of 10 x 10 pixels all shaded black with bit depth of 8 bits (1 byte). Bitmapped Graphic Data Image Bitmap Compressed Bitmap Original file: 100 bytes Compressed file: 40 bytes

  17. Storage of graphic data Graphics Interchange Format (GIF) Compressed using LZWlossless compression with a colour depth of 8-bits and a palette of 256 RGB colours. Colour limitation means not suited to photographs but ideal for continuous colour blocks e.g. logos, clip-art etc. GIF supports transparency and animation, usually 25 frames per second and with a separate 256 colour palette per frame. Bitmapped Graphic Data • GIF files can be stored as: • Non-interlaced - each line of the image is drawn one after the other • Interlaced - every alternate line or bit (fuzzy to sharp) is drawn and then the rest after. Advantage: with interlaced the user can see the graphic build up and decide whether they want to view it before the full image is complete.

  18. Storage of graphic data Lempel-Ziv-Welch (LZW) A lossless data compression algorithm that is part of the GIF format. It stores repeated patterns of data in a dictionary/table and uses pointers to point to the dictionary to obtain the colour code for the pixels in the pattern. Bitmapped Graphic Data

  19. Storage of graphic data Portable Network Graphics (PNG) Designed to replace GIF; uses lossless compression and up to 256 colours from an RGB palette-indexed colour table (CLUT) or can be 24-bit RGB. Parts of the image can be made transparent i.e. a single pixel value or an alpha channel. Can be interlaced allowing a clearer low-resolution image to be visible earlier in the transfer. Bitmapped Graphic Data PNGs are better than JPGs for storing photographs that require further editing. Once finally edited, the PNG can be converted to JPEG to reduce file size. However they are single-image so do not support animation.

  20. Storage of graphic data Joint Photographic Expert Group (JPEG) A graphics format that uses lossy compression to cut out parts of the image that the human eye will not notice. It supports 24-bit colour and is suited to graduated colours and textures so works well for photographs. Advantage Far superior to GIF, and preferable to PNG as files sizes are smaller (due to lossy compression) with very little loss of overall quality. Disadvantage Suffers from generation loss i.e. the loss of quality when editing after compression. Bitmapped Graphic Data

  21. How to calculate the number of pixels Example An image is 400 pixels by 400 pixels at 72 dpi. How many pixels in this image? Solution No. of pixels: 400 x 400 = 160,000 pixels Example An image is 2 x 3 inches at 2048 dpi. How many pixels in this image? Solution No. of pixels: 2048 x 2048 x 2 x 3 = 25,165,824 pixels Bitmapped Graphic Data

  22. How to calculate file size Example An image is 2 x 3 inches at 2048 dpi and has a colour depth of 24 bits. What is the file size of this image? Formula File size (bits) = resolution (pixels) x colour depth (bits) 8 Or File size (bytes) = resolution (pixels) x colour depth (bytes) Solution No. of pixels: 2 x 3 x 2048 x 2048 = 25,165,824 pixels Colour depth: 3 bytes = 25,165,824 pixels x 3 bytes = 75,497,472 bytes = 75,497,472 bytes / 1024 / 1024 = 72 Mbytes. = 72 Mbytes File Size Bitmapped Graphic Data

  23. How to calculate colour depth Example An image is 2 x 3 inches at 2048 dpi and has a file size of exactly 72 Mb. What is the colour depth of this image? Formula Colour depth (bits) = No. of bits resolution (pixels) Solution No. of pixels: 2 x 3 x 2048 x 2048 = 25,165,824 pixels No. of bits: 72 x 1024 x 1024 = 603,979,776 bits = 603, 979, 776 bits / 25, 165, 625 pixels = 24 bits per pixel = 24 bit colour depth Bitmapped Graphic Data

  24. Dithering Dithering is a technique that creates an illusion of extra colours and shades by varying the pattern of dots. It has the effect of mixing colours together to improve the appearance or ‘gradation’ of colour. The image below has bands of colour instead of a gradual transition between colours. Colours reduced Dithered Bitmapped Graphic Data Applying dithering reduces the banding effect. Dithering is the most common method of reducing the colour range of an image such as a JPEG down to 256 colours (or less) such as an 8-bit GIF.

  25. Before anti-aliasing After anti-aliasing Result Anti-aliasing Anti-aliasing simulates extra resolution in an image to reduce its ‘blocky’ appearance. It has the effect of fooling the human eye into seeing straight lines and curves where there are none! No anti-aliasing With anti-aliasing Lets take a closer look: Bitmapped Graphic Data Anti-aliasing shades pixels around an image using intermediate colours between the foreground and the background.

  26. Anti-aliasing Here is the Marr College badge… ….and a close-up of the anti-aliasing. Bitmapped Graphic Data

  27. Scale by 400% Resample 100 x 100 pixels 400 x 400 pixels After resampling Increase resolution - Resampling It is possible to increase the resolution of a graphic by ‘resampling’ it and reducing the effect of pixellation. Resampling is the process of adding colour to the new pixels created when an image is enlarged. Example A graphic, 100 x 100 pixels is rescaled by 400%, so now 400 x 400 pixels. Each pixel is replaced by 4 x 4 pixels so 16 times more of the same colour! Bitmapped Graphic Data Each additional pixel is given an individual and distinct colour which was found by calculating the average colour value of the four neighbouring pixels (a mathematical technique known as bicubic interpolation.). However, resampling is only a kind of ‘guesstimate’ and image will quality will be lost. Better to capture the image at a higher resolution in the first place!!

  28. Resolution The effect of doubling the resolution of an image is file size x 4. Resolution is a linear measure so results in 4 times the pixels in a given area. Bitmapped Graphic Data

  29. Graphics cards Graphics Processing Unit (GPU) A graphics card has its own GPU which can generate images faster and of better quality than the main processor and frees the main CPU from the load e.g. 3-D graphics require millions of calculations to be performed each time they are drawn! The graphics card has chips that convert analogue signals to digital signals, known as ADC / DAC. Bitmapped Graphic Data Digital Signal Processing (DSP) Processes the signal to remove noise/distortion/allows the addition of effects to be applied by the hardware.

More Related