How to read pixel color in a java BufferedImage with transparency

后端 未结 1 1051
野的像风
野的像风 2020-12-15 10:18

I am reading pixel color in a BufferedImage as follows:

.....
InputStream is = new BufferedInputStream(conn.getInputStream());
BufferedImage image = ImageIO.         


        
相关标签:
1条回答
  • 2020-12-15 10:29
    int alpha = (colour>>24) & 0xff;
    

    The result is also a value ranging from 0 (completely transparent) to 255 (completely opaque).

    0 讨论(0)
提交回复
热议问题