Is it possible to add transparency to jpg in Java and Android
<p>I want to load some images to the cloud, but I want to add some protections when someone views the photos and saves the images; they will not see anything because of the transparency. </p>

<p>would the code be common for Java and Android?  I would like to prototype it in Java first.</p>

<p>I have found some code that combines two files.  One file is my main file the other is a transparent file.  The combined file does not have a transparent overlay.  </p>

<p>Do I need to use an image drawing order?
<a href="http://www.developer.nokia.com/document/Java_Developers_Library_v2/GUID-D3E35E6F-0C45-48ED-B09D-F716E14C1C02/javax/microedition/amms/control/imageeffect/OverlayControl.html" rel="nofollow">http://www.developer.nokia.com/document/Java_Developers_Library_v2/GUID-D3E35E6F-0C45-48ED-B09D-F716E14C1C02/javax/microedition/amms/control/imageeffect/OverlayControl.html</a></p>

<pre><code>    BufferedImage image = ImageIO.read(new File("rose.jpg"));
    BufferedImage overlay = ImageIO.read(new File("myimg1.gif"));


    // create the new image, canvas size is the max. of both image sizes
    int w = Math.max(image.getWidth(), overlay.getWidth());
    int h = Math.max(image.getHeight(), overlay.getHeight());
    BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

    // paint both images, preserving the alpha channels
    Graphics g = combined.getGraphics();
    g.drawImage(image, 0, 0, null);
    g.drawImage(overlay, 0, 0, null);

    // Save as new image
    ImageIO.write(combined, "PNG", new File("combined.png"));
</code></pre>
