next up previous
Next: Pixel Independent Operations Up: Java's Image Processing Previous: Java's Image Processing

The Java Color Model

JAVA has a class named Color. In order to create a Color object, the red, green and blue components must be specified as floating point numbers between zero and one. Alternatively one can specify hue, saturation and brightness and the equivalent color will be created. Internally JAVA stores color components as 8-bit values between 0 and 255. An RGB color is a 32-bit integer of the form: 0xAARRGGBB

where AA represents the image transparency value (ie. the extent to which any images displayed behind the current image are visible, whch is not relevant here), and RR, GG, BB the red, green and blue values. The JAVA image class allows the programmer to access the image as a one-dimensional array. Pixel values are stored in each element of the array in the above form.



Bob Fisher
Fri Jul 4 16:11:50 BST 1997