Page 14 - DCAP504_Computer Graphics
P. 14

Unit 1: Fundamentals of Computer Graphics




                                  A 6×41/2 inch image and a 1024×768 inch image have an aspect ratio of 4/3,
                                  whereas 2×2 inch image and 512×512 inch image have the aspect ratio of 1/1.
               An image’s individual pixels can be indicated by their co-ordinates. Classically, the pixel at the lower
               left corner of the image is considered to be at the origin (0, 0) of a pixel co-ordinate system.


                                  The pixel at the lower right corner of a 640×480 image would have (639, 0)
                                  co-ordinates, the pixel at the upper left corner would have (0, 479)  co-ordinates
                                  and the pixel at the upper right corner would have (639, 479) co-ordinates.
               1.4   Direct Coding
               The representation of image is fundamentally the representation of pixel colors. Direct coding helps to
               allocate a specific amount of storage space for each pixel, in order to code its color.

                                  Consider a scenario, where  3 bits are  allocated for each pixel, where each
                                  primary color  will have one bit. This  representation of  3 bit permits each
                                  primary color to vary independently between two intensity levels like 0 being
                                  the off and 1 being the on. Therefore, each pixel is able to take any of the eight
                                  colors which correspond to the RGB color cube corners.
               The table 1.1 depicts the direct coding of colors using the 3 bits given in the above example.

                                        Table 1.1: Direct Coding of Colors with 3 bits


                  Red                Green                Blue                Color Names
                  Bit 1              Bit 2                Bit 3
                  0                  0                    0                   Black
                  0                  0                    1                   Blue
                  0                  1                    0                   Green
                  0                  1                    1                   Cyan
                  1                  0                    0                   Red
                  1                  0                    1                   Magenta
                  1                  1                    0                   Yellow
                  1                  1                    1                   White


               A widely accepted industry standard uses 3 bits or 24 bits per pixel, with one byte for each primary
               color. With the help of this, all the primary colors are allowed to have  256 different intensity levels
               equivalent to binary values from 00000000 to 11111111. Therefore, a pixel can take on a color from
               256×256×256 or 16.7 million possible choices. A 24-bit format is commonly referred to as the true color
               representation.  The reason is the difference between two colors, which differ by one intensity level in
               one or more of the primary colors. This difference is virtually unnoticeable under normal viewing
               conditions. Therefore, a precise representation involving  more bits is of modest use  in terms of
               supposed color accuracy.
               The most notable special  aspect of direct coding is the black,  white  and gray  scale image
               representations.

               A black and white image needs only one bit per pixel, where the bit value 0 represents black and bit
               value 1 represents white. The gray scaled image is typically coded with 8 bits per pixel, in order to
               allow a total of 256 intensity levels or gray levels.
               Although this direct coding method has simplified and supported a variety of applications, there is a
               relatively high demand for storage space with reference to the 24-bit standard can be seen.







                                        LOVELY PROFESSIONAL UNIVERSITY                           7
   9   10   11   12   13   14   15   16   17   18   19