Loading transparent background gif on an image

Hello everyone! I am trying to load a transparent background gif([http://www.aoml.noaa.gov/hrd/tcfaq/graphics/animehurr.gif]) on another image (which is a map). My way is adding two JPanels, each of them will load an image as an ImageIcon, however, the gif will display its transparent background as white. So, I googled the problem, it seems someone has a similar problem([t-681840]). I think the background area is not transparent due to the wrong container under the image, but I have no clue to make it right. I appeciated anyone can post a comment, or give me some advice.
I attach my code as following.
    jPanel1 = new JPanel();
    getContentPane().add(jPanel1);
    jPanel1.setBounds(12, 10, 647, 358);
    ImageIcon iconMap = new ImageIcon("C:\\1\\com\\lfhsolutions\\trackthis\\images\\Map.JPG"); 
    JLabel label1 = new JLabel(); 
    label1.setIcon(iconMap);  
    jPanel1.add(label1);  
    this.getContentPane().add(jPanel1);
    setVisible(true);
    jPanel2 = new JPanel();
    getContentPane().add(jPanel2);
    jPanel2.setBounds(330, 200, 50, 46);
    ImageIcon iconHurricane = new ImageIcon("C:\\1\\com\\lfhsolutions\\trackthis\\images\\hurricane1.gif");
    JLabel label2 = new JLabel();
    label2.setIcon(iconHurricane);
    jPanel2.add(label2);
    this.getContentPane().add(jPanel2);
    setVisible(true);

Sorry if my code bothers u, camickr !
I am a noob for java and thie forum. I am not quite sure how a SSCCE should look at, but I will post code as below.
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.List;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
public class NewJFrame1 extends javax.swing.JFrame {
  //Set Look & Feel
  try {
   javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
  } catch(Exception e) {
   e.printStackTrace();
private JPanel jPanel2;
private JPanel jPanel1;
* Auto-generated main method to display this JFrame
public static void main(String[] args) {
  SwingUtilities.invokeLater(new Runnable() {
   public void run() {
    NewJFrame1 inst = new NewJFrame1();
    inst.setLocationRelativeTo(null);
    inst.setVisible(true);
public NewJFrame1() {
  super("Hurricane Tracker to Oil and Gas Producers");
  initGUI();
private void initGUI() {
  try {
   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
   getContentPane().setLayout(null);
    jPanel1 = new JPanel();
    getContentPane().add(jPanel1);
    jPanel1.setBounds(12, 10, 647, 358);
    ImageIcon iconMap = new ImageIcon("C:\\1\\com\\lfhsolutions\\trackthis\\images\\Map.JPG"); 
    JLabel label1 = new JLabel(); 
    label1.setIcon(iconMap);  
    jPanel1.add(label1);  
    this.getContentPane().add(jPanel1);
    setVisible(true);
    jPanel2 = new JPanel();
    getContentPane().add(jPanel2);
    jPanel2.setBounds(330, 200, 50, 46);
    ImageIcon iconHurricane = new ImageIcon("C:\\1\\com\\lfhsolutions\\trackthis\\images\\hurricane1.gif");
    JLabel label2 = new JLabel();
    label2.setIcon(iconHurricane);
    jPanel2.add(label2);
    this.getContentPane().add(jPanel2);
    setVisible(true);
   pack();
   this.setSize(806, 549);
  } catch (Exception e) {
   e.printStackTrace();
}}

Similar Messages

  • Combining 100 pngs with transparent background, vertically into one image PSE9

    As the question suggests,
    In PSE9 is it possible to combine 100+ PNG files (with identical dimensions & transparent background) into a single PNG file where the images are stacked vertically? and without trimming/cropping the transparent part of the image! I want to retain the exact original image dimensions so that they all stack neatly and precisely. 
    So far what I've tried is opening up the 100 PNG files in PSE9, create a new document with transparent background using the same width as the individual files and the height set to the individual file height multiplied by 100. (i.e. original image is 36 x 120 so the new file will be 36 x 12000) Then I get stuck! Whenever I drag a single file into the newly created document, it seems to be cropped to the image edges and no longer retains it's original height and width. Not to mention that hand dragging 100 files seems like a long-winded way of doing things... My automate button seems to be greyed out (so no contact sheet?) and I can't find any other automated process.
    Any help would be greatly appreciated,
    Thanks
    N.
    PSE 9 on Win 7

    Please compare the resoultion of the two documents too. And a better way of arranging the layers would be to use distribute option in the move tool. You can find more about the move tool at http://helpx.adobe.com/photoshop-elements/using/moving-copying-selections.html#main-pars_h eading_0
    Thus your workflow would be:
    Create a new document with the required dimension.
    Use File>Place to place all your png files on the created document as layers
    Use distribute option in move tool
    A still better workflow would be to use put all the files in a folder and write an ExtendScript to read the files and place them as layers on the document of said dimension

  • Trying to create transparent background on line art image

    I have an image that's black line are over a white background. I'm wanting to make that background transparent, and then lay it over another image so that only the dark lines show.
    I've tried making the background of the line art image transparent, and then Placing that image on top of the other image, but it came in with a white background. I'm looking for the full photoshop version equivalent of where you could select the background color, and set it to transparency.
    Also, give I have the line art image already placed on the background image, if there's a way to change the transparency of that image, that would be even better.
    I'm going by instructions on the support page "Change the background color of a document", but I'm not sure where it is I open the Fonts window.
    Any help on this will be greatly appreciated.
    d

    If you want to create a blank file with transparent background, go to File>new>blank file, then select "transparent" under Background Contents,
    If you open an image with a white background, the Background layer is a locked layer. Duplicate the background layer; it will titled background copy layer
    Now, shut off the visibility of the background layer. Then, access the magic wand tool, click on a white area, and hit delete on the keyboard. On this tool''s option bar, you will have to check or unckeck contiguous, depending on the configuration of background/foreground interface. The tolerance setting may have to be adjusted for optimal results. The checkerboard pattern denotes transparency.
    If you save your file, be sure to select a file type that supports transparency.

  • How do you set a transparent background when adding an image?

    I've added a block arrow image to a slide in Captivate 4. I enabled Transparent background and selected white as the color within the Image properties. This used to work when I added the same image in Captivate 3. However, in Captivate 4, when I publish, the image displays with a white background. Though it is transparent in priview mode and on the slide iteself when i have the project open. Any ideas on what else I could do to make the image background transparent?

    Hi there
    Transparent background should still work in Captivate 4 just as it did in Captivate 3.
    There are a couple of reasons it may not do what you are expecting.
    The background isn't truly the color it appears to be. For example, it may APPEAR to be solid white (or another color) but in reality it's hundreds of varying shades of the color. This happens a lot with JPEG images.
    If the image is PNG format, I've seen Captivate become confused. Especially if the PNG already has a transparent background. So you may need to edit the image and save in a different format.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Image with transparent background CS5 to A3

    I have clipped an image in PS and put it on a transparent background and reduced the image to 600 pixels high. I saved it as a png with "web and devices." When I import it into my A3 library it has some rubbish on the background. Adobe forum (an employee plus others) tells me that A3 has trouble with transparency. Help would be much appreciated. Thanks, jp
    Lefthand photo: image previewed in PS "web and devices" Right hand photo: Same image after being imported into A3 library.

    Thanks loads Bob, just as you posted that, i found that link on another thread and came back to post it and you beat me to the punch! So thanks loads!
    So if my printer is going to print this catalogue in litho print, rather than digital, do i still have to go back and flatten etc ?? I've separated the catalogue off to 108 individual pages with bleeds etc and it looks like I've got a fun friday night opening each one of them !!! rats!!
    thanks loads, kind regards,
    Charmaine

  • Insert an image button with a transparent background?

    I would like to be able to use an image button with a
    transparent background. I have converted my graphic files to .gifs
    with transparent backgrounds. But when imported into Captivate,
    they have a white background. If I insert as an image button and
    check "transparent" it turns the entire image transparent. Is it
    possible to have a transparent background when using the image
    button functionality in Captivate? Thanks!

    I still cannot get this work. Does anyone have anymore help?
    I have .gif files for the image button with a transparent
    background. When I insert into Captivate as an image I can click
    the option for a transparent background, and the image appears in
    my Captivate project with a transparent background. Now, what I
    really want to do is insert this into my project as a button. I
    insert this into Captivate as an image button (there is no option
    for a transparent background) and the image appears in my Captivate
    project with a white background. Is it possible to have an image
    button with a transparent background? Do I need to do a workaround
    (something like, use my image along with a transparent button or
    clickbox on top of the image?) Thanks for the help.

  • Images with Transparent Backgrounds.

    I would like to have an image with a transparent background, so that any image underneath will show through. I know that this can be done with watermarks, but I would like the flexibility to move the image around on a book page background. Is this possible in Aperture?

    I still believe this a software problem with Pages
    Ah, but your belief is based on suppositions and the suppositions are not based on data processing developments -:)
    Apple Pages is a client of Apple ColorSync which is the Apple interface to the colour imaging architecture of ISO 15076 aka the architecture of the International Color Consortium. Apple ColorSync is also the interface to the Adobe PostScript colour imaging architecture for applications that depend on Apple Mac OS X to write Adobe PostScript, as Apple Pages does. Adobe InDesign, Adobe Illustrator, Adobe Photoshop, Adobe Acrobat, and QuarkXPress write their own PostScript, known as passthrough PostScript (cf the Adobe Acrobat interface, for instance).
    That aside, you want to begin by NOT configuring your inkjet printer(s) with uncoated copy paper. As a rule, uncoated copy paper has so much optical brightener that it positively fluoresces in broad daylight. Try measuring with a spectrophotometer, and you will see the *b channel in the CIELa*b D50 2 degree standard observer measurement way, way, way out in the negatives.
    Find the inkjet paper the manufacturer intended, and find the manufacturer's ICC profile for that paper. Then calibrate your printer as per the manufacturer's documentation, configure the ICC profile for that paper in the manufacturer's driver, and you should be OK. If you are not using a paper made by the manufacturer, find a photographer who can build you an ICC profile.
    Cheers,
    Henrik

  • Setting a transparent background

    Is it possible to set a transparent background in Aperture 3? i.e. erase the background of a photo to plane white then setting the transparency for plane white. Attempting to make a transparent background to add the image to a photo.
    r/
    Patrick

    Welcome to the list. Make sure you read the [Help & Terms of Use|http://discussions.apple.com/help.jspa] section when you get a chance.
    No its not possible. You'll need something like Gimp or PS for that.

  • Transparent Background in 'tiff'

    Hi
    I'm having a heck of a time trying to get an image 'tiff' to save with a transparent background.  The original image was sent to me as a .pdf, I opened the .pdf and saved as a tiff.  I then using the pen tool traced around the object, selected inverse and deleted the background.  Everything thus far worked to plan, except when I import the 'tiff' image into 'InDesign' it has a white background.  I then reloaded the image and saved in 'PNG-8", same results.
    What am I doing wrong?
    Thanks..

    There’s no transparency support in tiffs (well sort of - multi layer tiff… but let’s ignore that for now).
    If you just need it to import into indesign, just save it as a PSD file — but beware, you can make very large PSDs that can slow down indesign, you may want to save a separate flattened (except the transparency) version if you get into complex photoshop documents.
    PNG also offers transparency and can be useful for other things, primarily RGB applications (like transparent things in Powerpoint, Keynote or on the web).
    Good luck!

  • Help with transparent background

    I'm trying to get a transparent background on this attached image. It is made of a bunch of little dots, cool right? Except when you are trying to get the background removed. I basically need to get just the dots and get rid of all the grey/white background.
    I picked up the file from shutterstock. I have the JPG and EPS files. Any help/advice would be much appreciated.
    Thanks!

    if you open the eps in illustrator, is the white background an object you can select?

  • Images in themes no longer have transparent background after upgrade?

    I've just upgraded to iLife 09 and also Snow Leopard. Unfortunately when I open iDVD the 7.0 themes won't load properly. There is no dropzone in the Revolution theme and the Sunflower theme moving images no longer have transparent background so have black backgrounds. Even the Apple icon has a black background, it's as though the gifs have gone to jpegs and no longer transparent??
    Older themes seem to work better but the Apple icon always has a black background?
    I've deleted the preferences for iDVD but it hasn't helped & loaded all the updates that the system is telling me to. Any ideas?

    Hi thanks for reply & the useful app. I've deleted and reinstalled just iDVD v7 but I still have the same problem. Indeed reading around it looks like older macs cannot handle the new version but my iMac is relatively new so assume many more folks would have the same issue but I can't find anyone else with the same issue as me? Also these exact same themes ran fine before my upgrades (OS & iLife) All other apps run fine.
    I did burn a disk & the quality was terrible on a DVD player, fine on a PC/Mac. I thought I hadn't selected PAL but all the settings seemed ok but its B&W and scratchy from the DVD player.
    See hardware details below.
    Hardware Overview:
    Model Name: iMac
    Model Identifier: iMac7,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.8 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 4 GB
    Bus Speed: 800 MHz
    Boot ROM Version: IM71.007A.B03
    SMC Version (system): 1.21f4
    Serial Number (system): W87510NEX8A
    Hardware UUID: 00000000-0000-1000-8000-001EC2061655
    ATI Radeon HD 2600 Pro:
    Chipset Model: ATI,RadeonHD2600
    Type: GPU
    Bus: PCIe
    PCIe Lane Width: x16
    VRAM (Total): 256 MB
    Vendor: ATI (0x1002)
    Device ID: 0x9583
    Revision ID: 0x0000
    ROM Revision: 113-B2250F-219
    EFI Driver Version: 01.00.219
    Displays:
    iMac:
    Resolution: 1920 x 1200
    Pixel Depth: 32-Bit Color (ARGB8888)
    Main Display: Yes
    Mirror: Off
    Online: Yes
    Built-In: Yes
    Display Connector:
    Status: No Display Connected

  • GIF file with transparent background (white spots)

    Hii. I've been having a problem. I was trying to make a signature earlier with gif on photoshop cs5. I tried making it with a transparent background and when I put it up on the forum, it gave me white spots. It's not noticeable with a white background as the spots are white, but with another color background, it would show. Can someone tell me why?
    -- this is the image i made with a transparent background. and because it didn't work out, I decided to not use a transparent background and used a color of the background of the forum which was off gray. I know i have erased all of the white spots in the transparent file becuase it seems perfectly fine in the one with a gray background.
    Can someone fill me in on as to what i am doing wrong?

    Gif only supports 1 bit transparency: either on or off. The edges of your artwork are anti-aliased, and these cannot be converted neatly without setting the matte colour in the save for web dialog.
    With Gif you have two option: either live with the coloured fringe surrounding your artwork (and it will only display correct when the background color matches the matte colour, or remove every single anti-aliased pixel, effectively creating a perfect sharp pixel edge.
    Neither options are great: with the first option you always run the risk of ugly artifacts around the edges when the background color does not match, and with a perfect pixel edge it may look somewhat jaggy.
    Solution: avoid Gif, and instead save as a fully transparent PNG. File size-wise not the greatest option, because Photoshop cannot optimize a PNG file properly. To do that, load up Color Quantizer, and open the PNG file. Then set the number of colours to about 256~512 (should be more than enough in your case), and save.
    Done!
    Get Color Quantizer here: http://x128.ho.ua/color-quantizer.html
    If certain areas in your artwork look less than ideal, make use of quality mask/brush in CQ.

  • Animated gif with transparent background

    When I import in Keynote an animated gif with transparent background. The background becomes white. I did the following tests:
    If I extract a single image from the animated gif and import it in keynote the background is actually transparent but it becomes white when I import the whole gif.
    I also checked with other applications (NeoOffice) and the animated gif does come out with a transparent background.
    Do I do something wrong in Keynote ?

    This has been an ongoing issue for me since I switched from Powerpoint to Keynote. Most of the animated gifs with transparent backgrounds that I used with Powerpoint are no longer transparent in Keynote. You may want to search for those earlier threads on this topic...
    To summarize: I've had to open up my animated gifs in After Effects and use the Color Key effect to restore transparency, with mixed success.
    Good luck!

  • How to export animated gif with transparent background and glow effect?

    I've been having issues lately with creating animated gifs in flash. I finally figured out a way to export a gif with a transparent background but I'm now having an issue with it again because I'm using a glow effect. When the gif is exported the glow effect changes into a very poor quality and becomes less of a glow and more like a solid color. I've even exported a png sequence from flash and put it into photoshop then created a gif from there but I'm still having the same issue. Is there anyway I can properly export this in gif form so the quality is the same as when I test it in flash?
    I've provided an image of what my issue looks like and the settings (I've messed around with the settings and this is the best I can come up with) . This is in photoshop but the result is similar in flash. The left one is what it originally looks like and the right is what it will look like after exporting. As you can see as I said before the glow changes into more of a solid color kind of like a border. Any help would be greatly appreciated, thanks in advance!

    A GIF is limited to 256 colors while a glow effect likely wants to tie up thousands (let's just say 'lots') of variations of tone.

  • How do I import animated gifs into Premiere with a transparent background?

    I have an animated gif that I got from the internet, and I'm trying to import it into Premiere Pro with a transparent background. The gif is of a video game character standing still and blinking. Whenever I import it, it always has a white background, so I need help on how to change that.
    I've gone into Photoshop and removed the white background frame by frame, making it transparent. I do this by using the magic wand tool to select the white background, then hit "delete" to turn it into that diamond grid, which means it's transparent. I then select File -> Save for Web. I preview every frame, and it shows that the backgrounds are transparent. I save it as a gif. But when I import it into Premiere Pro, the white background is still there.
    I've read many forums online about people trying to import images into Premiere Pro with a transparent background, but none of them have explained how to do it specifically for animated gifs. Every answer has always been "export the image as a png, that'll work", and sure enough, I exported a few frames of the gif as pngs, and those few frames had transparent backgrounds in Premiere Pro. But I don't want a png because those aren't animated sequences, those can only be still images. I need to export it as a gif so that it will remain animated, but gif files always have that dreaded white background in Premiere Pro.
    I suppose I could export every frame as a png, import each of those frames into Premiere Pro, then string all the frames together and tweak them so they'll be functionally identical to the animated gif, but that would take forever. I'm making a video project and I need numerous animated gifs to work with, so I don't want to do that with every single one of them. I'm looking for a way to simply import the gifs into Premiere Pro and be done with it. If there is any way to do this, please help me.
    -Robert

    faind on gif transparency and other cartoon animation problems : Adobe After Effects
    " The reason: GIFs don't support alpha channels. Instead, their file structure assigns a certain color value to be read as totally transparent. There aren't any degrees of transparency as you find in graphics formats that do support alpha channels.
    To use an animated gif in AE, you'd first have to create the areas of transparency, then convert the series of images into a graphics format that supports alpha channels, and there are a bunch: PICT, TIFF, TARGA or PNG, to name a few."

Maybe you are looking for

  • P Tax is not getting displayed in the payslip

    Hi All, The P Tax is not getting displayed in payslip. I have checked the customization again but no use. In PA30 (IT0588) i have 'checked' the box for P Tax eligibility and have also assigned /3P3 in the form IN01 in window 2 (for deductions). Pleas

  • Returning error to Javascript from Webkit plugin

    Hi all, I want to return an error and possibly error string using exception or any other means from a web kit plug-in to Java script. In the success case these functions returns NSString, NSNumber,... etc. Can some one pls. provide a sample code to r

  • Problems returning VARRAY (or  TABLE) / method  on _IOraDatabase failure

    I am trying to return a VARRAY through OO4O (currently using VB6) but am getting an error back that I don't seem to be able to resolve. The SQL procedure is declared as: PROCEDURE "RD_GET_TOPOAREAS2_SIZED" ( minX IN NUMBER, minY IN NUMBER, maxX IN NU

  • Output determination: Dispatch time for Outline Agreements

    Hi gurus, I have an issue, when I am creating an outline agreement, by defaul the output message type: NEU is showed, and, it is fine, but, the dispatch time is always = 1 - Send with periodically schedule job. In the customising of the output NEU, I

  • Createdb10.sql with error "ORACLE not available"

    guys.. I have installed PeopleTools 8.49 and PeopleSoft HRMS 9. I installed Oracle 11gR1 on OEL 5.3 I create /oradata/DEMO111/create by my self. I modified file createdb10.sql set termout on set echo on spool createdb.log startup nomount pfile=$ORACL