Similarly, if all the 8 bits of ALPHA is set to 1 i.e., 1111 1111. Then converting this value into decimal, we will get (0000 0000) 2 = 0 10 Therefore, if all the 8 bits of ALPHA is set to 0 i.e., 0000 0000. The bit position of the 4 components is summarized in the table belowĮach of these bit position will take any of the two bit values or binary values i.e., 0 or 1. The first bit is at the rightmost side and is numbered or indexed 0 and the last bit is at the leftmost side and is numbered or indexed 31. Alpha take the leftmost 8 bits while Blue takes the rightmost 8 bits of the pixel. The image shown below represent a single pixel value consisting of 32 bits. And since a pixel has 4 components so, the total number of bits required to store the value of all the four components ARGB is equal to 4x8 = 32 bits or 4 bytes. This means we will need only 8 bits to store the value of any of the four component. So, 8 bits can represent any value in the range 0 to 255. We generally denote these four components as A for Alpha, R for Red, G for Green and B for Blue.Įach of these four components (ARGB) take a value between 0 to 255 both inclusive, where 0 means the component is missing and 255 means the component is fully present. The smallest unit of an image is called a Pixel, and it is generally made up of 4 components namely:Īlpha determines the transparency while Red, Green and Blue determines the color of the pixel.
How to get pixel values of an image and how to set pixel value of an image in Java programming language. We will learn how to store pixel value in a variable. In this theory part of the Image Processing Project we will learn about pixels.