Skip to content

Page 3: Image Representation

A. M. Cajal edited this page Dec 9, 2018 · 1 revision

IMAGE REPRESENTATION

First of all, the 8-bit term makes reference to the look of the images, not to a specific implementation of the code.

Images are coded as vectors (or arrays, in C language terminology), of X*Y elements, being X the width and Y the height. Each vector element represents a pixel of the image with a specific color. This is known as Direct Color. The pixel colors are codified in RGB format, using 8 bits for each channel. Thus, each pixel can be represented using a 32-bit data type. Take into consideration that the 8 last bits (from bit 31 to 24) are not used (no transparency applied here). In this way, each channel can take values from 0 to 255.

The following image assemble all of this together, representing a 4-pixel image in its various interpretations (as the final image, as the vector representation, and as a specific implementation in the C language).

8bh_image_representation

Clone this wiki locally