code: public final void setA(double alpha, int x, int y){
          int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
          int idx = x + y * width;
          int tmpR = pixels[idx] >> 16 & 0x000000ff;
          int tmpG = pixels[idx] >> 8  & 0x000000ff;
          int tmpB = pixels[idx]       & 0x000000ff;
          pixels[idx] = (int)alpha << 24 |
                              tmpR << 16 |
                              tmpG << 8  |
                              tmpB;
      }
docs: Sets the alpha value of the pixel data in this Image.
  
  @param alpha
  The alpha value of the pixel.
  @param x
  The x-coordinate of the pixel.
  @param y
  The y-coordinate of the pixel.