title: Make image's opacity using alpha in RGBA
body: <p>I tried to make a simple program which load an image, make it blue effect, and also make it half transperant. I'm doing it by running on the image pixels and change the RGB's blue value and alpha value. I successed to make a nice blue effect to the image. But I couldn't manage to change the image opacity. It seems that no matter how I change the alpha value of the pixels, it doesn't effect the image.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>try {
      image1 = ImageIO.read(new File("image1.png"));
  } catch(IOException e) {e.printStackTrace();}
  
  
  for(int x=0;x&lt;image1.getWidth();x++) {
      for(int y=0;y&lt;image1.getHeight();y++) {
          int rgb = image1.getRGB(x, y);
          Color color = new Color(rgb);
          int r = color.getRed();
          int g = color.getGreen();
          int b = color.getBlue();
          int a = color.getAlpha();
  
          System.out.println(a);
          a= 100;
          if(b&lt;155)
              b+=100;
          else
              b=255;
  
          color = new Color(r,g,b,a);
  
          image1.setRGB(x, y, color.getRGB());
      }
  }
  </code></pre>
  
  <p>UPDATE:
  I also tried this. still doesn't work:</p>
  
  <pre><code>for(int x=0;x&lt;image1.getWidth();x++) {
      for(int y=0;y&lt;image1.getHeight();y++) {
          int rgb = image1.getRGB(x, y);
          Color color = new Color(rgb,true);
          int r = color.getRed();
          int g = color.getGreen();
          int b = color.getBlue();
          int a = color.getAlpha();
  
          a= 100;
          if(b&lt;155)
              b+=100;
          else
              b=255;
  
  
          rgb = rgb | b;
          rgb = rgb &amp; 0x33ffffff;
  
  
          image1.setRGB(x, y, rgb);
      }
  }
  </code></pre>