Overlaying two images

Hi,
I want to be able to overlay two maps, to get a composite image. Like a temperature map of the US with the pressure overlaid on it, so that pressure contours are visible. The real problem is, in a way the images themselves. The images that i am using dont have 'transparent' regions. So when i simply put one on top of the other, i dont get a composite.
http://groundhog.sprl.umich.edu/onesky/local/scripts/image/us_pr.gif
http://groundhog.sprl.umich.edu/onesky/local/scripts/image/us_st.gif
These are two sample images.
I want to create an applet which will download these and generate a 'composite image'
Any assistance will be most welcome!!!
Thank you!!

To get transparency you need to do this:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
//draw an image into that image
image.setRGB(x,y, (alpha << 24 | red << 16 | green << 8 | blue));
to make a pixel transparent, set alpha to 0. You could iterate through an image and set each pixel containing a specific rgb value to transparent and then draw this image directly into another image (myImage.getGraphics().drawImage(...)).
Regards,
Nille

Similar Messages

  • Overlay two images and one of them is a bit transparent, but sill visible

    Hello,
    Is there a way to overlay two images of the same size and at the same time both of them to be visible ? I could't find anything about this in the forum so far.
    Thanks,
    IG 

    Hi igurov,
    see this link please.
    Mike

  • Overlay two images in the same container

    Hi,
    I don't know if it's possible, but in my webdynpro application I have a transparent container with an image, amont other stuff, inside. I've created the image as a cl_wd_link_to_action object, because when the user clicks over it, an action is triggered.
    My question is if it would be possible to add another image to the container, so both images are overlapped. For example, suppose you have an image representing a document and after it is reviewed, a tick icon appears over the document image.
    Is this possible?

    Am not sure with dynamic programing, even don't have clue regarding overlapping one component with another. Alternatively I can suggest you to place two images which can toggle visibility in between them when clicked

  • Re: How to Join two images

    Do you want to side by side the images so one is on the left and the other on the right? If so just make them the appropriate size and copy them to the correct locations.
    If you want to overlay on onto the other then xor them.

    i have tried following code but it gives me image of 2 strips
    public static void joinImage()throws Exception{
              //loads two images with ImageIO
              //for testing purpose both header and content image are same
              BufferedImage imageHeader=ImageIO.read(new File("/home/g.pol/images/DSC04249.JPG"));
              System.out.println(""+imageHeader.getHeight()+" "+imageHeader.getWidth());
         BufferedImage imageContent=ImageIO.read(new File("/home/g.pol/images/DSC04249.JPG"));
         //create new BufferedImage instance of same width and height as that of merging images
         BufferedImage resultantImage=new BufferedImage(imageHeader.getWidth(),imageHeader.getHeight()*2,BufferedImage.TYPE_INT_ARGB);
         //get graphichs of resultant image
         Graphics resultantGraphics=resultantImage.getGraphics();
         //draw image on graphics with width is same as that of test images but height 1/2 of test image
         resultantGraphics.drawImage(imageHeader,0,0,null);
         resultantGraphics.drawImage(imageContent,0,50,null);
         ImageIO.write(resultantImage,"jpg",new File("/home/g.pol/images/result.JPG"));
         System.out.println("success");
         }

  • Layering two Images with transparency

    Ok, so I have my own JComponent, and for the painting I have two Images.
    The main one which contains all the stuff I want to paint, and the overlay which contains temporary thing I want on top of the main one.
    To make this work, I need overlay to be transparent as it is drawn on top of the main one.
    But for some reason I can not get this to work, the pixels in the overlay (and possibly the main) are completely opaque!
    Here's the relevant code:
    public void addNotify() {
              super.addNotify();
              Color trans = new Color(0, 0, 0, 0);
              image = createImage(WIDTH, HEIGHT);
              graphics = image.getGraphics();
              graphics.setPaintMode();
              graphics.setColor(trans);
              graphics.fillRect(0, 0, WIDTH, HEIGHT);
              overlay = createImage(WIDTH, HEIGHT);
              overlayGraphics = overlay.getGraphics();
              overlayGraphics.setPaintMode();
              overlayGraphics.setColor(trans);
              overlayGraphics.fillRect(0, 0, WIDTH, HEIGHT);
              setBackground(Color.WHITE);
    public void paint(Graphics g) {
              g.drawImage(image, 0, 0, this);
              g.drawImage(overlay, 0, 0, this);
    }Can anyone help me get this to work?

    1. For custom painting in JComponent, override paintComponent(...), not paint(...)
    2. Painting a transparent rectangle over an opaque background isn't going to automagically make the overlay image transparent. You have omitted to post the most relevant part of your code, namely the createImage(...) method, so we don't even know whether you have an Image type that supports transparency.
    db

  • How do I use the move tool in CS5 to put two images on to an A4 sheet?

    Have recently upgraded from CS3 to CS5.
    I often print out two images on A4 paper.  Under CS3 I would simply adjust and crop 2 images to say 7 ins x 5 ins, after that bring up a new A4 sized sheet (file, new), then using the move tool I'd move the two separate images on to the A4 sheet and print.  Fine!
    Now under CS5, once I've adjusted my first image then try to bring up a second image to adjust that one I seem to lose the first one from the screen.  But on going back via Bridge and clicking on the image it re-appears - problem is, I lose the second image.
    When I bring up a new A4 sheet neither of the images stay on the screen and there is nothing to move.
    Have been into Preferences to see if there is anything there to help but can't see anything.
    Does anyone know what is happening here and what I'm doing wrong i.e. how do I get 2 separate images on to an A4 sheet?
    Thanks,
    Bob Eveleigh.

    There have been changes since cs3, mainly that cs5 uses tabs.
    Tabs can be confusing if your coming from cs3.
    If your in the tabbed mode, try going to Window>Arrange>Tile.
    All your open documents should be visible on the screen.
    If this is the cause of your frustrations, you can read more here:
    http://help.adobe.com/en_US/photoshop/cs/using/WS8599BC5C-3E44-406c-9288-C3B3BBEB5E88.html #WS6389D09B-91D5-4474-9AED-C52AE33356EB
    MTSTUNER

  • Two images at the same time

    Hi!
    I'm new into FCE and I would like to ask for some help. Can I work with two images at the same time? I mean, Can I superimpose two images to make one? How can I do it?
    Maybe this is something easy, but I'm just starting,
    thanks in advance for your answers
    Message was edited by: angelcotallo

    Yes, you can. You can put one clip on top of the other in the timeline. You can make both clips visible by reducing the opposite of the clip or top, or by scaling back the clips so they are smaller. You can reduce the opacity and scale of the clips in the viewer by opening the clips from the timeline into the viewer. You can also scale the images directly in the canvas when it is in Image+Wireframe mode.

  • How to combine two images in preview onto one page

    Sorry if this topic doesn't go here - there wasn't a "preview" category.
    I have two images that i want to print out on the same page and right now they are each on a separate page in the same file in preview. Does anyone know how I can combine them onto one page?
    Thanks
    Message was edited by: p-rock

    Hi -
    I load two images in Preview and select them.
    !http://www.spotsbeforeyoureyes.com/Preview1.jpg!
    Then I select Print Selected Images:
    !http://www.spotsbeforeyoureyes.com/Preview2.jpg!
    When the print dialog box opens, I select Images per Page:2
    !http://www.spotsbeforeyoureyes.com/Preview3.jpg!
    Hope this helps.
    MtD

  • IO - Read two image files and put them into one file

    Hi,
    i have 3 files in all. The two image files and one text file. I need to place the image in the first image file, followed by text in the text file and then the image in the second image file, into one file.
    Can anyone tell me how do i go about doing this ?
    i tried using fileinputstream and fileoutputstream, which works fine if all the 3 files have text but when the first and the third file have image, the code doesn't give any error but the result file displays only the image from the first file and nothing else.
    i am running short of time and need to do this really soon.
    if anyone has done anything like this. please let me know,
    thanx,
    poonam

    One approach would be to programmatcally create a single zip/jar file from the three input files. You can use the java.util.zip and java.util.jar packages for this purpose.
    The other apprach would be to create a single image by drawing images and text strings on a BufferedImage object.
    I think the first approach is preferable because you can easily extract the individual files from the zip/jar file

  • Two images on a page, want to number each image.  How?

    Page layout with two images on a page, other pages have one image.  I want to have a number associated with each image.  I tried page numbering to no avail.  How do I have a sequence number for each image?
    I further complicate this; I will make many documents, each document will have about five pages, as I progress, I want the photo numbers to function likek page numbers, across all the documents. 
    How do I accomplish this?
    Rob

    Thank you, I am closer to the solution after following your instructions. On the Master pages (Two page spread), I made a text frame adjacent to each of two frames for the images (There will be two images on each document page, thus two frames on each Master Page).  They are threaded together and I verified this by View > Show Text Threads.
    Since I am not getting the right result, I must have done something wrong.  I made numbered List using Paragrach Styles.  I could not find "text attribubutes" so I am probably not doing this right.  Please note that I have spent 7 hours on this so far, so I am making an effort. 
    It seems reasonable that this should be done on a Master layout, is this right?  So far, the text frame number flow from 1 to 4 across the the Master Page spread.  Thus the first two pages are correct.  However, when page is added based on the Master it repeats the same flow: 1 though 4.  I expect this because that's what the Master shows,  However, I want the numbers to continue as I add photos to additional pages.
    Thank you for any additional information you are willing to provide. 

  • Is it possible to paste two images into one layer?

    I'm having some issues pasting two images into one layer. Every time I paste the second image, it automatically creates a new layer...is there anyway to prevent that from happening? I'm making an animation on photoshop and I want there to be more than image in some of the frames. Please let me know if you have any suggestions! Thanks!

    You can merge the two layers together once they're position. Select the top layer and choose merge down or select both and choose merge layers (from the layers menu).
    http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-78b2a.html

  • Recommended distortion method for matching two images

    I have two images of North America as separate layers that I'm trying to line up as closely as possible. One is a color image of the earth's surface while the other is a grayscale image representing the topography of the terrain. There are many obvious visual features in the images to use for matching, but I'm not sure what is the best tool or workflow for distorting, scaling, skewing, etc. I have previously been using "Warp," but while I can line up certain areas easily, other areas appear quite difficult to line up. I'm wishing there was a way to define "features" that I want matched up and then let Photoshop do an automated process, but I think that may be asking a little much. Because the images may have been taken from different angles, it's not just a simple non-proportional scale problem. Some areas need to be squished while other areas need to be stretched. Any suggestions?

    If the two maps are from different sources or different times, or have been created using different map projections, or if the two maps have different levels of accuracy, you may not be able to get a perfect match-up.
    Neil

  • Why I can't subtract two images in imaq vision builder?

    Hi,
    I have many times tried but failed to get the objects in a image by subtraction with another image which is background, in imaq vision builder(ver. 6.0). I totally can't use the "operators" command under "greyscale" to subtract the two images becauee all commands under the "greyscale" are always unactivated after two images have been stored in 2 idfferent buffers. I really don't know why and this vision builder is so difficult to use, unbelievable! I followed the instructions in its Help and it's quite simple but I totally failed to make this operation!
    Two samples of images have been attached and maybe it's very ease for you to filter out objects(fibers) by subtraction each other. Show me your scrip
    t if you can. It's urgent to me.
    Or the idea of the way I thought for filtering the objects is wrong? Point out please if you know.
    Thanks and Merry Christmas and Happy New year!!
    Swedlin
    Attachments:
    10Img0.jpg ‏27 KB
    123Img0.jpg ‏25 KB

    Okay, this is not quite as straightforward as it could be, but you can do image subtraction in Vision Builder. The basic idea is as follows:
    - select first object image and copy it to buffer 1
    - select "image >> get new image" and load your background image from a file.
    - put this in buffer 2
    - retrieve object image from buffer 1
    - perform subtraction. Even though these images appear to be greyscale, they are actually saved as 24-bit RGB images, so you need to use the color operators instead. Vision Builder will only allow you to select steps that are valid for the image you have loaded. You could extract the luminance plane from all of your images to work with 8-bit images if you like.
    I have attached below a background image, several object i
    mages, my script, and the results of batch processing. You will need to edit the "get new image" step with the correct path to the background image on your machine.
    Bruce is right though. This is a bit easier in LabVIEW.
    Regards,
    Brent R.
    Applications Engineer
    National Instruments

  • SuperImpose two images and save it as a single image[urgent]

    Hello..
    Can anyone tell me how do we superimpose two images and save it as a single image.The image on the top is smaller in size in my case.
    Please Help..

    import java.awt.Graphics2D;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    class TwoBecomeOne {
        public static void main(String[] args) throws IOException {
            BufferedImage large = ImageIO.read(new File("images/tiger.jpg"));
            BufferedImage small = ImageIO.read(new File("images/bclynx.jpg"));
            int w = large.getWidth();
            int h = large.getHeight();
            int type = BufferedImage.TYPE_INT_RGB;
            BufferedImage image = new BufferedImage(w, h, type);
            Graphics2D g2 = image.createGraphics();
            g2.drawImage(large, 0, 0, null);
            g2.drawImage(small, 10, 10, null);
            g2.dispose();
            ImageIO.write(image, "jpg", new File("twoInOne.jpg"));
            JOptionPane.showMessageDialog(null, new ImageIcon(image), "",
                                          JOptionPane.PLAIN_MESSAGE);
    }

  • How do we compare two images in labview?

    I have created a back end code which is comparing two images using LABVIEW.i have used a comparator and put a tolerance factor which will help me filter out almost same images.the problem i am facing is that on subtraction of the given two images i am getting a completely random output with noise surrounding the parts of the image which are being compared.Also the tolerance percentage i have given has not been working very effectively.Kindly let me know if there is an easier solution to my task or what needs to be done
    Thank you

    Can you post your code?
    Randall Pursley

Maybe you are looking for

  • Batch to be activated  for a material

    We need to activate Batch Management for a material which was already created and some transactions also done with that. We have done the following : 1) All required settings done in SPRO 2) All documents for that material have been deleted. There ar

  • Oracle 10g is stealing my processor at 10pm

    Hi All, I have a real time application running on the same server as Oracle 10g. I dont use the database during real time operation, only for persistant store of config data. At 10pm each night an Oracle process is consuming all CPU on one of the pro

  • Upgrading Rulebased applications to 10g database.

    Hi It may sound silly for you. I just wanted to know what happens upgrading my pl/sql code which is on Oracle 8i versions using Rule based optimizer to 10g database without channging it to CBO. What would be the worst thing it can happen, assuming th

  • Since upgrading OS last week, my phone is dropping calls constantly and connections are awful!  Any correlation?  How can I fix it??

    After upgrading to the latest OS a few days ago, both my husband and I are experiencing bad connections and dropped calls after a few seconds.  Not sure if the problem is related to the upgrade or not but ready to toss my phone and go Droid if I can'

  • How to store deployment plans to custom directory?

    Hi All , I am deploying Jmsadapter.rar to weblogic 10.3.6 (admin)server which contains 2 managed servers. Below is the command java weblogic.Deployer -adminurl t3://${admin host}:${admin port} -remote -verbose -username ${user} -password ${password}