Could anyone explain for me how java stores color in TYPE_INT_RGB and TYPE_INT_ARGB ?
Do these lines of code work properly for calculating red, green and blue ?
The TYPE_INT_ARGB
represents Color as an int
(4 bytes) with alpha channel in bits 24-31, red channels in 16-23, green in 8-15 and blue in 0-7.
The TYPE_INT_RGB
represents Color as an int
(4 bytes) int the same way of TYPE_INT_ARGB
, but the alpha channel is ignored (or the bits 24-31 are 0).
Look the javadoc of java.awt.Color and java.awt.image.BufferedImage.