Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

encoding of pixels in Javas AWT?

AWT encoding Java Javas pixels
0
10 Posted

encoding of pixels in Javas AWT?

0

<< Previous question: Access image pixels Next question: Java imaging libraries >> At some places in the AWT, classes use a special encoding to store a pixel as a single int value. This includes PixelGrabber, MemoryImageSource and the methods getRGB and setRGB of the BufferedImage class. In Java, int values are always 32 bits large. ARGB encoding uses a single int value to store four values for red, green, blue and a transparency value (alpha). Each of these four values is eight bits large, allowing for 28 (256) different values from 0 to 255. The intensity of red, green and blue is on a linear scale from not used (0) to fully used (255). The alpha value ranges from 0 for transparent (the pixel itself cannot be seen, only what is behind it) to 255 for opaque (nothing from behind the pixel shines through). Now for the actual encoding. The least signficant eight bits are used by blue, the next eight bits by green, then eight bits for red and the most significant eight bits are used for t

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.