2 Bitmapped Graphic Data Hardware – CCDCharge-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 Bitmapped Graphic Data Hardware – CCDAn 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 DataEach 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 Bitmapped Graphic Data Hardware – Digital CameraDigital camerasHave a 2D rectangular array of CCD sensors to capture the imageEach CCD sensor captures the light for roughly one pixelTherefore the more CCDs the higher the resolution of the imageThe CCD converts the light into an electrical signal i.e. a voltageAn ADC is used to convert the signal to a digital signalNow the image can be stored on the computer in digital formBitmapped Graphic Data
5 Bitmapped Graphic Data Capturing photo-images/videoSequence of eventsImage1 Select IMAGELens2 Image is directed through LENSCCD3 Light attracted to CCD sensorsBitmapped Graphic DataADC4 Pass analogue signal through ADC chipDSP5 Apply signal processing via DSPStorage6 Store on backing storage
6 Bitmapped Graphic Data Hardware – ScannerScannerHard copy of image is scannedLight is reflected onto light-sensitive diodes that translate the light into a voltageAn ADC converter translates each voltage into a digital pixelPixel data is transferred to a software application the data can be read fromBitmapped Graphic Data
7 Bitmapped Graphic Data Role of ADCWhen 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 Bitmapped Graphic Data Storage of graphic dataBitmapsThe 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:Number of colours = 2 bit depthBitmapped Graphic DataExamplesBit depth is 1 bit: 21 => 2x1 = 2 coloursBit depth is 2 bits: 22 => 2x2 = 4 coloursBit depth is 3 bits: 23 => 2x2x2 = 8 colours…Bit depth is 8 bits: 28 = 2x2x2x2x2x2x2x2 = 256 coloursSo, a bitmap that has 16 colours means a bit depth of 4 bits!
9 Bitmapped Graphic Data Storage of graphic dataIndexed ColourColours 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 DataAdvantage: Indexed Colour reduces file/memory size and transfer times.Disadvantage: Limited number of distinct colours.
10 Bitmapped Graphic Data Storage of graphic dataIndexed Colour Examples16 colours4 coloursBitmapped Graphic Data256 colours24 bits
11 Bitmapped Graphic Data Storage of graphic data24-bit BitmapA set of 3 bytes (24 bits) represents the colour of each pixel, known as the RGB Colour Code.Green0-255RedBlueEach pixel actually consists of three smaller dots – one for each of the primary colours, which in electronics are Red, Green and Blue.Bitmapped Graphic DataIn 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 Bitmapped Graphic Data Storage of graphic dataBitmapped Graphic Data
13 Bitmapped Graphic Data Hexadecimal and colour codesExtensionHex 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, FWhere 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 – 00 Blue - CCBitmapped Graphic DataAnd this converts nicely into binary and into decimal…..Colour:RedGreenBlueHex:9CBinary:Decimal:153204
14 Bitmapped Graphic Data Hexadecimal and colour codesExtensionIn 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 DataAlways remember though that the colour code will always be stored by the computer system as a 24-bit binary code!
15 Bitmapped Graphic Data Storage of graphic dataRun 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: aaaaaaaaaabbaaaaaabbaaaaaaaaaabbaaaaaabbAfter RLE: 10a2b6a2b10a2b6a2bSo original 40 characters reduced to 18 characters!RLE and bitmapsRLE 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 Bitmapped Graphic Data Storage of graphic dataExample – RLE and BitmapsA run of 10 x 10 pixels all shaded black with bit depth of 8 bits (1 byte).RLE algorithmBitmapped Graphic DataImageBitmapCompressed BitmapOriginal file: 100 bytesCompressed file: 40 bytes
17 Bitmapped Graphic Data Storage of graphic dataGraphics Interchange Format (GIF)Compressed using LZW lossless 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 DataGIF files can be stored as:Non-interlaced - each line of the image is drawn one after the otherInterlaced - 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 Interlacing in ActionAllows you to view an image before it is fully downloadedImage is gradually revealed
19 Bitmapped Graphic Data Storage of graphic dataLempel-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.Colour PatternDictionary Code12..256257258259Bitmapped Graphic DataOriginal ImageConverted to258,259,258
20 Bitmapped Graphic Data Storage of graphic dataPortable 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 DataPNGs 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.
21 Bitmapped Graphic Data Storage of graphic dataJoint 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.AdvantageFar superior to GIF, and preferable to PNG as files sizes are smaller (due to lossy compression) with very little loss of overall quality.DisadvantageSuffers from generation loss i.e. the loss of quality when editing after compression.Does not support transparencyBitmapped Graphic Data
22 Bitmapped Graphic Data How to calculate the number of pixelsExampleAn image is 400 pixels by 400 pixels at 72 dpi. How many pixels in this image?SolutionNo. of pixels: x 400 = 160,000 pixelsExampleAn image is 2 x 3 inches at 2048 dpi. How many pixels in this image?SolutionNo. of pixels: x 2048 x 2 x 3 = 25,165,824 pixelsBitmapped Graphic Data
23 Bitmapped Graphic Data How to calculate file sizeExampleAn 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?FormulaFile size (bits) = resolution (pixels) x colour depth (bits)8OrFile size (bytes) = resolution (pixels) x colour depth (bytes)SolutionNo. of pixels: 2 x 3 x 2048 x 2048 = 25,165,824 pixelsColour 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 SizeBitmapped Graphic Data
24 Bitmapped Graphic Data How to calculate colour depthExampleAn 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?FormulaColour depth (bits) = No. of bitsresolution (pixels)SolutionNo. of pixels: 2 x 3 x 2048 x 2048 = 25,165,824 pixelsNo. of bits: x 1024 x 1024 = 603,979,776 bits= 603, 979, 776 bits / 25, 165, 625 pixels = 24 bits per pixel= 24 bit colour depthBitmapped Graphic Data
25 Bitmapped Graphic Data DitheringDithering 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 reducedDitheredBitmapped Graphic DataApplying 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.
26 Dithering In Action 256 Colour 4 Colour Non-Dithered 4 Colour with Dithering
27 Bitmapped Graphic Data Anti-aliasingAnti-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-aliasingWith anti-aliasingLets take a closer look:Before anti-aliasingAfter anti-aliasingResultBitmapped Graphic DataAnti-aliasing shades pixels around an image using intermediate colours between the foreground and the background.
28 Bitmapped Graphic Data Anti-aliasingBitmapped Graphic DataBoth pieces of text have exactly the same resolution
29 Bitmapped Graphic Data Increase resolution - ResamplingIt 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.ExampleA 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!100 x 100 pixels400 x 400 pixelsAfter resamplingScale by 400%ResampleBitmapped Graphic DataEach 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!!
30 Bitmapped Graphic Data Graphics cardsGraphics 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 DataDigital Signal Processing (DSP)Processes the signal to remove noise/distortion/allows the addition of effects to be applied by the hardware.