How to make a BufferedImage background transparent?

I try to draw an image from a BufferedImage to a JPanel, which the original image background is transparent, but when I draw on the JPanel, its background becomes black color. How can I make it transparent?
My code is something like this:
img = Toolkit.getDefaultToolkit().getImage("tiger.gif");
try {
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(img, 0);
tracker.waitForID(0);
} catch (Exception e) {}
int width = img.getWidth(this);
int height = img.getHeight(this);
bImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
bImageG2D= bImage.createGraphics();
bImageG2D.drawImage(img, 0, 0, null);
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(bImage, 0, 0, null);
Thanks for the help!

Nekot,
It would be a great help if you can share your code of 'transparent bufferedimage' with me. I have been trying to create a transparent gif since long. Now I think I can create a transparent bufferedimage and display it.
Thanks,
Riddhi.

Similar Messages

  • PS 6.1, how to make a white background transparant?

    how to make a white background  transparent?

    Select the white background with Magic Wand tool.  Hit Delete.  Transparent background is denoted by the checkerboard pattern on your document.
    Nancy O.

  • How to make a white background Transparent

    I would like to to select the blocks and enclosed data to copy and paste in a poster, leaving out the white background.  In other words make the white background transparent. 
    This is just a plain low res jpg.
    This seems like it would be pretty easy but not for me.  Is there a tutorial that could guide me through this?
    Thank you for any guidance you can give me.

    I'm probably not being clear about what I'm trying to do.  Here's a typical poster.  I use the magnetic lasso to select an image, copy and paste it resulting in this.
    This time it's to be a team picture with small head shots of each player, action photos in the background, similar to this.  I can do all that but I wanted the tournament chart to lay on top of the background with just the boxes and enclosed info showing.  I know I can use the magnetic lasso or the poly lasso but I don't have enough patience for that.

  • How to make a .jpg background transparent?

    Windows XP; using Photoshop Elements 2.0 :  is it possible to edit a .jpg so that the background (white, in this instance) can be transparent so that when I copy the part of the graphic I want and paste it elsewhere (another layer in Photoshop or Illustrator) that the white background disappears and doesn't block out the layer underneath?  Thanks.

    You can also copy the picture,  including the white, to the destination picture. The new picture will be on a separate layer. On that layer delete the white portion which will be replaced by transparency. Depending on the particular case you can select the white and delete it; or select the subject, invert the selection and delete it.

  • Make .SWF player background transparent???

    Hello,
    I have created a small animated logo in flash and when I put
    in my DW project it shows the default flash white background.
    I remember about 2 months ago I found a way to make that
    white background transparent by typing a parameter in DW...But I
    dont remember what I typed...
    It was something like WMODE and then for the value
    TRANSPARENT or something.
    Can anyone please remind me how to do this. Thanks
    alot.

    http://www.projectseven.com/support/answers.asp?id=127
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "texjgc" <[email protected]> wrote in
    message
    news:fpe022$j7e$[email protected]..
    > Hello,
    >
    > I have created a small animated logo in flash and when I
    put in my DW
    > project
    > it shows the default flash white background.
    >
    > I remember about 2 months ago I found a way to make that
    white background
    > transparent by typing a parameter in DW...But I dont
    remember what I
    > typed...
    >
    > It was something like WMODE and then for the value
    TRANSPARENT or
    > something.
    >
    > Can anyone please remind me how to do this. Thanks alot.
    >

  • How to make a Transparence Background GIF Animated??

    Hi,
    How to make a Transparence Background GIF Animated??
    Any Special Pro software do i need like Photoshop ?
    Posible to use Keynote or something like that?
    Thanks

    See my response to your other topic in this forum.
    OT

  • Best Illustrator method to make a logo background "transparent..."

    I have seen that there are several posts regarding "transparent backgrounds," but but they're difficult to follow. I apologize if this is old territory. If there is a solution somewhere already, I'd appreciate your pointing me towards it.
    I'm using AI within CS5.5 but new to it. I am importing/converting a JPG file to vector format. The image is a logo with a large black circle boundry and a white opaque background. The background elements inside the boundry circle are also opaque white, and I wish to leave that as is. The edges of the circle touch the  boundries of the JPG file tangentially by about 100px or so on each side when the JPG is viewed at original size.
    My objective is to make everything outside the boundry circle a "transparent" background. What would be the best/easiest way to do this within AI? Is there, for example, a tool that will draw a circle that I can expand to get on the edge of the black boundry circle, and then make everything outside it transparent?
    Thanks very much.
    Regards,
    Arnold

    Jacob Bugge wrote:
    Arnold,
    I am importing/converting a JPG file to vector format. The image is a logo with a large black circle boundry and a white opaque background.
    The cleanest/best way to vectorize  the black circle, and most likely the other shapes, is to recreate, using the appropriate tools, thereby replacing the original raster parts.
    You may use the raster image as a locked template, maybe on its own lower layer.
    In that case there will be no outlying parts to get rid of.
    But f you just wish to get rid of the outlying part, you may create a circle (with the Ellipse Tool) following the outer rim of the black circle, select that and the image, and Object>Clipping mask>Make.
    OK, a quick progress report...
    I am now back at my main desk and in front of my instance of AI. I am attempting to implement the above suggestion of using the clipping mask. First, a bit more background.
    The object I'm trying to edit is a JPEG file with a logo design... a  black circle with a flat b/w design inside on an opaque white background. There is only one (1) layer, and AI reports the background as being "locked." When I open the JPEG file in AI, it appears as 100%, RGB raster (file is 2341x2344px original size). When I hover over the design with the "select" tool, I see a blue square outline (I assume this is the JPEG file boundry). The edges of the circle circumfrence touch each edge the blue square outline.
    I see how to invoke the elipse tool,  and how to make a clipping mask (I have to remember to select more than one object, or I'll get an error).  But what do I do from there? How do I save just the part that remains (after clipping) on a transparent background? Everything I've tried so far seems to save it on the white opaque background.
    I'm stuck at this point. All help appreciated.
    Regards,
    Arnold.

  • How to make a selection partially transparent?

    Hi. I open a jpg image in PS, use a quick selection tool to select what I want and then I'd like to make that selection 80% transparent. How do I do that?
    Thank you.

    One way is to convert the background layer to a regular layer, add a layer mask after making the selection, invert the layer mask and use the masks panel to control the transparency (density setting) of the selection.

  • How to make the status bar transparent

    can anyone help?

    Here it don`t make the status bar transparent...
    I`m trying to make UINavigationBar transparent too like Photo App and trying it but get nothing:
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
    [navigationController.navigationBar setTintColor:[UIColor colorWithWhite:0.2 alpha:0.6]];
    Some other idea how they do this? An application called Style.com do the same..
    Thank you

  • How to make UIPagecontrol of UIPageviewController transparent?

    I am using UIPageviewController in my application where i want to make UIPagecontrol of UIPageeviewController transparent.
    While giving background color to clear color its not working but when giving background color to any other color like red itsworking fine.

    With this image, it will be easiest to select the white background.
    1. I would recommend using the Quick Select Tool. Select the white background.
    2. Because you want the lung guy on his own layer not the white background, you need to invert the selection. Select<Inverse.
    3. Copy the lung guy onto his own layer. On PC, press ctrl + J. If on a Mac, the shortcut is cmd + J.
    4. You can now copy/paste lung guy in the desired photo. Alternately, you can drag his layer from the layers palette and drop him into the other document. (If the resolution of lung guy doesn't match your image's resolution, he will shrink or expand as his layer will take on the resolution of the document he is moved into.)
    Note: I would not use the lettering as you can see where the lung guy's image overlaps. It will be an easier project if you redo the lettering in Word or use the Photoshop Element's text tool...maybe with text warp and a layer style....to add the text.

  • How can I keep logo background transparent when flattening for web?

    Hi, I have a logo designed in Illustrator which I'm bringing into Photoshop to save it for the web. It comes into Photoshop with a transparent background, but when I save it for the web or flatten it, it gets a white background. Can you tell me how to keep the background transparent?

    File > save for web (& devices). That will give you the best and smallest web-ready graphics. With save as you're embedding all kinds of info that doesn't need to be in the image. File size can bloat ten-fold quickly. Use save for web.

  • How can I make a FlashAlbumExporter background transparent?

    I really like the very cool FAE (as suggested on this most excellent forum) but the gui offers no choice as for background opacity. A little search on the net reveals a few ideas but none of them seem to work. I am using the following iframe code in iWeb:
    <iframe src=
    "http://www.bostruyephotos.com/Paso_Robles/index.html"
    style="width:1000px; height:900px;
    border-width:0px;
    border-color:#990033;
    border-style:solid;"
    scrolling="auto" >
    </iframe>
    I don't know if the bg transparency is controlled in this iframe code, in the index.html file created by FAE or in the xml file created by FAE. So far I have tried:
    Remove the background-color: #181818; from the index.html didn't make any difference.
    Adding <bgcolor transparency="0"> in the xml made simpleviewer not display at all.
    Another web site was discussing using html in the HTML snippet widget instead of iframe and it seems to address the transparency issue. But it seems rather old and is setup to use a movie instead of a photo album so I'm not sure how to convert it. Here is that code:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v ersion=6,0,40,0"
    WIDTH="700" HEIGHT="700" id="MyMovieName">
    <PARAM NAME=movie VALUE="MyFlashMovie.swf">
    <param name="wmode" value="transparent">
    <PARAM NAME=quality VALUE=high>
    <PARAM NAME=base VALUE=".">
    <EMBED src="MyFlashMovie.swf" quality=high WIDTH="700" HEIGHT="700"
    NAME="MyMovieName" ALIGN="" TYPE="application/x-shockwave-flash" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" base=".">
    </EMBED>
    </OBJECT>
    Any idea how I can make this bg transparent so my bg will show behind the photos instead of the default dark grey?
    The current version is here in case that helps:
    http://www.bostruyephotos.com/Gallery/Cruising.html
    Thanks for any help.
    Bo

    If that's what you're doing, then just turn off the visibility of the layer that you made the selection on - most likely the BG layer by clicking on the eye icon in the layer's pallet.  You change the bg layer, as I mentioned above, and after you make your selection, click on the add layer mask icon in the layer's pallet,  This will add a layer mask with your selection.  If you hold alt/opt while doing this, it will create a inverse layer mask.

  • How do I make a solid Background Transparent?

    Hi All...
    I'm trying to make an image I have which has a solid background (and a few other details inside it) transparent? so I can still see behind the graphics in the image yet the background at the same time...  I know I've seen it before where the image sort of floats above the background...  But I don't know how to accomplish this in photoshop.
    Anyone?
    Thanks!

    Sorry.  That was my mistake.  I assumed that the text was on a perfect circle, but it is in fact on an elipse.
    I worked through to make sure I had not made other eronious assumptions!
    The first thing I did was add some canvas because the text was so close to the edge.  Easy enough to trim afterwards.
    Then I used the Magic wand to select the blue.  I did not care about the text as I was going to replace it.
    I inverted the selection so the fish was selected (Ctrl/Cmd Shift i)
    Then refine Edge.  Get close, then use the Expand selection slider to get as much of the fish as you can, and make sure you click on Decontaminate Colors to remove any trace of blue.
    Copy the fish to a new layer (Ctrl/Cmd j)
    Add another layer above the fish.  Ctrl/Cmd click the fish layer to select it, and go Edit > Stroke with one pixel black inside.  (If the original is larger than the one you posted, you may need a thicker stroke.
    OK you now have a nice crisp fish with a good solid black outline.
    use the eliptical Marquee tool, and drag to get as close to the inside the text as you can.  You can use the space bar to move while dragging.  if all else fails, you can Transform Selection to improve the fit.
    Go to the paths panel and choose 'Make work path from Selection.
    Select the type tool (I used Bradley hand ITC at 5.2mm) and click at the top of the path and insert your text.
    I left a couple of steps out for clarity.  I erased the old text, for instance, but while adding the new text, I inserted a layer between the type layer and original background layer and filled it with white so I could see the new text more clearly.  Then I deleted it when finished.
    I didn't add the bubbles, but it is really easy to do so with brushes I linked to further up this thread.  I hope thatclears it all up.
    BTW  The one on the right has a transparent background.  Other than the fish, the rest of the image on the left was created from scratch.

  • How to make animations float with transparent background

    I am taking a graduate course in adv. web design for an ed
    tech program at a university. Neither my instructor nor anyone else
    in my class knows how to get Flash animations to have a transparent
    background, or even if this is possible. On behalf of us all, I am
    wondering if it is possible to create a Flash animation without a
    background--or with a transparent background, and then superimpose
    it onto a web page so that the web page's background shows through
    all but the animated part. We are using Flash 8. If it is possible,
    can someone please tell us how to do it? I have seen web pages
    where the animations float over the web page. Are these animations
    made with Flash or with another program? Thank you!

    Yes, it's easy, but haven't done it for a while, and not
    since all the new ActiveX stuff on MS IE requires Java Script to
    make the dotted outline go away.
    To do it well takes a combination of Flash with the
    publish-settings HTML Window Mode set to Transparent Windowless,
    and tightly-designed CSS with your animation positioned in a div
    that lies or overlays the exact place on the HTML page where you
    want it. You can even have it scale to the entire visible window,
    which can be quite cool. I did one for the holidays with snow
    falling over an HTML page. It can block lnks from working, though,
    so you can have the div (and animation) disappear when the
    animation is done.

  • How to make a trasnparent background in Motion

    I am just making a Lower Third and I want to be able to bring it into FCP and place it on top of my existing timeline. I dont want to export FCP to Motion because I already chroma keyed my "stuff" in FCP. How do I make a transparent background for Motion? Hm!! Any other suggestions would be nice too !

    I think you may be mis-interpreting what the blend mode does.
    If you apply the screen blend mode to the fire clip in Motion without anything below it, and view transparent in the viewer, you'll notice that the blacks in the fire clip don't disappear. It's waiting to blend it's values with a clip below it. If no clip is below it, then nothing visual happens. If you place a colored solid below, then you'll see the effect of the blend mode.
    FCP handles composite modes differently. If you do the same thing in FCP, the blacks WILL disappear from the fire clip even though there is nothing below it. Perhaps that is why they are called "composite" modes in FCP, and "blend" modes in Motion.
    Finally, a Motion clip is like a QT clip. It can contain, video, audio, tc, and transparency info. A blend mode is not technically transparency information. Besides, in the example that you give me, the blend is between the fire and the text clip. Not between the motion project file and FCP clip in the timeline.
    How ever the Motion project looks in Motion is how it'll look in FCP (with the exception of Motion Blur).

Maybe you are looking for

  • Copy File from One Location to Another Location through xcopy or any

    Hi, I Need to copy one file from one location to another location. That file need to save in C:\Windows\System32 folder I need to create one .bat file and i want apply that bat as a startup script through GPO. I tried through XCopy if i test in machi

  • Submit button(s) on a form

    Following all the instructions I cannot make a pdf that will submit the filled out forms to my email address. What is the trick. I usually get a message not allowed. As long as I preview in Acrobat Professional 8.0 everything works fine but when in A

  • Adobe Media Encoder Update for Mac not working?

    Hey! My Premiere says that there is an update available for the AME. When i open the PatchInstaller it says: "This Patch is not suitable for you." In a normal case AME is installed together with Adobe Premiere, isn't it?

  • Seeing Videos in iPhoto

    When I download video from my camera to my Mac, iPhoto "sees" the video as only a single photograph, not as a video. What am I doing wrong?

  • Airport Express Networking

    I've been using AE for a single computer connection. I tried to open up the network for my relatives PC by turing on internet sharing. When I do this I get the middle finger from my my airport icon (litertally) and get closed out of my own interent a