Creating a text with transparent background using javax.media.j3d.Raster

Hi, I'm trying to display a text in Java3D using the Raster but I'm not sure to make the background of the text transparent. Does anyone have any ideas.
Here's my code for creating the Raster image:
private javax.media.j3d.Raster getRaster(String str, boolean rotate) {
// Create an empty raster.
javax.media.j3d.Raster raster = new javax.media.j3d.Raster();
// Get a font metrics.
Font font = new Font("Times", Font.PLAIN, 12);
FontMetrics fm = getFontMetrics(font);
// Calculate the raster size.
int width = SwingUtilities.computeStringWidth(fm, str) + 6;
int height = 18;
// Create an BufferedImage.
BufferedImage image = new BufferedImage(width,
height,
BufferedImage.TYPE_INT_BGR);
// Draw the input string on the BufferedImage.
Graphics2D g2d = (Graphics2D) image.getGraphics();
g2d.setFont(font);
g2d.setColor(Color.WHITE);
g2d.drawString(str, 3, 14);
// Set the BufferedImage to the raster.
raster.setImage(new ImageComponent2D(ImageComponent2D.FORMAT_RGB, image));
raster.setSize(width, height);
raster.setType(javax.media.j3d.Raster.RASTER_COLOR);
raster.setCapability(javax.media.j3d.Raster.ALLOW_IMAGE_WRITE);
raster.setCapability(javax.media.j3d.Raster.ALLOW_SIZE_READ);
return raster;
Thank you for your help.

Hi,
If you create a new transparent imge you can put a color fill layer below the text layer and either turn off  the layer visiblity for the color fill layer (eye beside the color fill layer in the layers panel)
or delete the color fill layer before saving the file as a transparent png.

Similar Messages

  • How in Illustrator I write text with transparent background ?

    How in Illustrator I write text with transparent background ?

    that is correct. You open it in AI and you have an option to use area text, you first take the text tool and drag to make a text frame, which wors like it does in a layout program. Or you click the text tool any where on the canvas and just start typing if you want to make another line you either hit the return (enter) key or for  soft return use shift/return (enter).
    The default is a transparent background.
    All art i Illustrator is on a transparent background unless you add an object behind other objects that has a fill color.

  • How to create typography jpg with transparent background?

    I am creating jpg artwork of typography to place on WIX.com and need to create the jpg with transparent background behind the font. Any suggestions that work?

    You're welcome.. If this solves the problem, be sure to mark the solving answer correct. This makes it easier for other users to find solutions for similar issues.
    Benjamin

  • How to create image slice with transparent background without white halo around?

    Hi, I want to make slice image with transparent background. I set the slice option background color to my background color. But when the image is on my html page set against the same background color, it has white halo around:
    How can I get rid of the white halo?
    I need the slice image to have transparent background and not have a color background because it's going on a rollover button with the background change. I don't want it to look like this on rollover:

    >it looks to me like you built it with that "halo" to start with.
    No, I didn't put in the halo myself. The shape is a character from the Webdings font. It's set to some darker fill color and set on a transparent background. Photoshop put the white halo there after "Save For Web".
    > Make your graphic on a transparent background and Save for Web
    I did exactly that, see:
    I set the slice background to my color. I try the Matte option and come out the same with white halo.
    It seems I'm not making Photoshop antialias to my background color, instead Photoshop just antialias to white.
    What else do I need to do?

  • 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

  • Video with Transparent background

    Hi I am trying to create a video through Adobe Premiere Elemements 10 that has a transparent background.
    I need it to be in .FLV, .SWF or .MP4 format.
    I have created the alpha etc but i think i am not exporting it correctly.
    Can anyone explain the steps for creating the video with transparent background and how to export it for those file types please?
    thanks.

    I've not used the software, as I said a quick google threw it up. From looking at their further screens (http://www.increditools.com/flash_video_studio/features.php#flash8alpha) and (http://www.increditools.com/flash_video_studio/samples.php#flash8alpha) a probable workflow would be to create an original in PRE against your green screen and export this as DV (for standard resolution) or HDV (for HiDef). Once in the Flash software it is probably then just a case of using an eyedropper to turn your green screen transparent.
    However your best option would be to install it and play around. Looking at their FAQ, similarly to the PRE trial, it installs as a trial version that will place a watermark across your finished video.
    If you do try it out please be sure to post back here about its effectiveness - it may help others.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • How to use/create icons with transparent background ?

    I would like to use icons with transparent background on JButtons, but I can't find how to do it. Until now, I've been using the ImageIcon class to create icons from GIF images. These images were created with MSPaint (sorry, I don't know what I could have used instead of that). Here is how I create my buttons :
    bPencil = new JButton(new ImageIcon("Pencil.GIF"));What could I do to make the background transparent and/or what software could I use instead of M$Paint ?
    P.S. : sorry if my question seems silly, but I'm a newbie in Java coding...

    Transparent images are GIF (256 colours) and PNG (true-colour, half transparency).
    You can store the image with your code, *.class files. You then even can deliver all inside a clickable, executable .jar file.
    This kind of usage is called "resource," and hence use getResource like this:
        java.net.URL imgURL = getClass().getResource("pencil.gif");
        ImageIcon icon = null;
        if (imgURL != null) {
            icon = new ImageIcon(imgURL, description);
        }You can use paths.
    There exist versions of MSPaint that easily loose their transparent colour on saving.
    For GIFs try internet palettes, or try to save as PNG (recent version).
    Start with a transparent image from elsewhere.

  • Creating animations with transparent backgrounds?

    I'm running into some problems when using After Effects to create animations with transparent backgrounds for Keynote...
    I use animated gifs and short quicktime movies with uniform backgrounds as source files, use color keying to take out the backgrounds, preview them to see if they look OK, render the results as RGB+alpha, and... they don't show up as transparent in Keynote. They work in Powerpoint, however. I've tried outputting as .mov, as .gif, as premultiplied vs straight alpha... no joy. Can someone explain (or point me to an explanation) of how Keynote differs from other programs in its handling of transparency? What am I missing?

    Using a TYPE_INT_ARGB BufferedImage worked beautifully. I had played around with Image for hours, but it never occurred to me that BufferedImage would be needed. :)
    many, many thanks,
    Steven

  • Want to create an oval vignette in photoshop elements 10 with transparent background for printing w

    I am fairly new to PSE and I want to create an oval vignette in Photoshop Elements 10 with transparent background for printing on white paper using MS Publisher. Using the white background on inverse selection makes a slight line impression and either it should have a defined "frame" or nothing.
    Appreciate any guidance.

    Try with the Elliptical marquee tool:
    On the tool's option bar set feather 25-40 px (experiment)
    Drag out the Ellipse to embrace the object
    Go to Layer>new>layer via copy, or CTRL+J
    Your selection should fade out as a vignette and be surrounded by transparency
    Save this layer via File>save for web, select PNG-24, and tick "Transparency"

  • Using animated gifs with transparent background.

    Hi guys,
    Keynotes 6.2.
    I have been onto apple support with this problem.
    I add a transparent animated gif to my project.
    It show as a movie correctly in the presentation but when exported as quicktime or HTML the movies fail.
    We eventually found out that quicktime does not support animated gifs. ( support.apple.com/kb/ht3775 )
    So I exported the animation onto a folder with all the frames separately and brought them into final cut pro.
    I then followed these tutorials on how to export with transparent background. ( http://provideocoalition.com/mspencer/video/fcp-x-and-alpha-channels and http://www.larryjordan.biz/fcp-export-transparency ).
    I now have a quicktime movie that if I bring back into Final Cut Pro it has a transparent background.
    However when I bring into keynotes it still has a black background. (presumably keynotes does not recognise the  Apple Prores 444).
    Any ideas how I can achieve what I need. ?
    I am using a program called crazytalk animator and can output with transparent background. Animated Gif or a series of image stills BMP, JPEG, TGA or PNG.
    Cheers
    SteveW

    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 do I transfer a .psd file to illustrator that can then be placed in Muse as a .svg with transparent background?

    I just wrote all this up in another thread.  I did not realize at the time that the last post was in 2014, so I'm giving it a go here.
    I am currently trying to create an .svg using Photoshop .psd file (with layers in tact).  I'm new to these products so it may be obvious to others that the above intention was to eventually place the .svg in some sort of website creation software such as Muse.  Which is precisely what I am attempting. However, I am getting a white background once I place or copy and paste into Muse.  My starting .psd has a transparent background without any hidden layers causing this problem.  To test this I placed the .psd file into Muse and it still has a transparent background.  However when opening or placing this file into illustrator, it picks up a white background. If I do exactly as described above, I still get the same result.  So far I have tried:
    1) Simple copy and paste from Photoshop .svg to illustrator to Muse.  Result - white background.
    2) Placing the .psd in illustrator, then placing the .svg file in muse.  Result - white background.
    4) I have also tried the every combination of 1 and 2. - Result - white background.
    3) I have now created a path in Photoshop from the text layer to yet again attempt the above methods.  Result - white background.
    I'm including an image of the object I am trying to place with transparent background, but I have both a flattened rasterized version, a version complete with layers and a third (.svg) with the corresponding objects.  I am completely new to Illustrator as of today so any help would be greatly appreciated.  Thanks.
    Link to .psd file "Welcome text"

    I was having some difficulties getting the correct dimensions of one of my objects, I eventually solved this problem without using svg.  It was pretty simple when I stopped trying to over complicate things.  I just linked the object to a near by object in photoshop, merged and placed it all as one.  It looks great now.  Thanks for your reply.  You are correct, SVG was not the answer.

  • Creating a PDF with Transparent Images

    Hi,
    Here is my problem:
    I am using Acrobat 9. I design posters in another program. I print to PDF.
    I design the poster and must put a logo in it with a transparent background. Note: If the poster background is white I never have any problems.
    This poster has a pink background and hence I have to put the logo into the poster in a graphic type of gif or tiff or png to maintain transparency.
    All is fine in my design program - transparency is fine etc.
    I print to PDF (Acrobat 9.0) and the dreaded white box occurs. Note, I put an old version of the logo, one I cannot use, and it maintained its transparency fine. So this means that some gif files Acrobat 9.0 keeps transparency and some it does not.
    So, in summary, I have tried all types of file formats gif, png, tiff and all types of programs to remove the logo background and save as one of the later formats and NONE maintain the transparency in the PDF output.
    I have even tried saving the whole poster as a jpeg - but the quality was too poor to print.
    I have used Word, Photoshop, MS Photodraw, Elements etc.
    I have no idea why a gif I have from years ago works and one that I am creating now maintain their tranparency in the PDF.
    I am under a deadline and am VERY worried this will not get done.
    I am immensely grateful for any help - I have been at this for countless weeks and hours...
    Thanks,
    Elisabeth

    I am using MS Publisher and even Word 2010 for poster design and have used multiple programs (and multiple formats that support transparency)  for logo editing - removal of background - Photoshop, etc.
    I place logos, both gifs, with transparent backgrounds in a document and print PDF and one or none will show transparency - it makes no sense at all.
    Most of the time the background is a white block. It couldnt be more frustrating.
    It is a simple document/poster with just a few words of text and a logo...
    Are there settings in Acrobat 9.0 that need to be turned on that I am missing. I had no trouble with Acrobat 7 - it worked EVERY time.
    I was on  with tech support for 5 hrs and there was no knowledge of this - he just wanted to reinstall 7.0 which did not work.
    Need ideas - overprinting is on. I noticed that flattening doesnt allow me to pick transparent objects - have no ideas if I am even on the right track.
    Have read everything I can find online regarding Acrobat 9.0, PDF creation and transparent logo backgrounds.
    Sooo grateful for any help!
    Thanks,
    Elisabeth

  • Framing image with transparent background png frame

    hi,
    i'm trying to find a way to frame images with transparent background png frames...
    what i'm doing now is
    1-drawing my image on a panel
    2-creating a 2nd image using the frame's filename, stretching this 'frame-image' to a size slighlty larger than that of my main image and drawing the 'frame-image'
    the problems with this method are:
    1-depending on the width of the frame, the frame sometimes hides parts of the image (thick frame), and sometimes there is a gap between the frame and the image (thin frame).
    2-if the image file containing the frame is larger than the frame (Ex: The image is 300x300, the frame is centered in this image and is 200x200; as opposed to the image is 200x200 and the frame takes up all the space), when i position the 'frame-image' near the top left corner of the image i want to frame, the frame appears at the wrong place (shifted down and to the right). This is due to the fact that i'm placing the top corner of the created 'frame-image' and not the frame, who is not in the top corner of my 'frame-image'.
    Is there a way to do what i'm trying to do???
    My ideas (which i don't know how to achieve are)
    1-To 'analyse' my transparent background png file and
         1-only keep the frame,
         2-calculate the frame's thickness
    OR
    2-Let java do the analyzing for me and tell it to frame my image with the frame in the png file
    please feel free to ask for more explanations if my description/question is confusing,
    thanks.

    Have you looked into the Border interface? If what you really want to do
    is put a custom border on a component, you may be able to do it this way.
    Anyway, here is some code that stacks and centres 2 images. It's not hard to do.
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class Example extends JComponent {
        private BufferedImage backgroundImage;
        private BufferedImage foregroundImage;
        public Example(BufferedImage backgroundImage, BufferedImage foregroundImage) {
            this.backgroundImage = backgroundImage;
            this.foregroundImage = foregroundImage;
        public Dimension getPreferredSize() {
            int w = backgroundImage.getWidth();
            int h = backgroundImage.getHeight();
            return new Dimension(w, h); //assuming this is bigger
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            //paint both, centred
            int x0 = (w-backgroundImage.getWidth())/2, y0 = (h-backgroundImage.getHeight())/2;
            g.drawImage(backgroundImage, x0, y0, null);
            int x1 = (w-foregroundImage.getWidth())/2, y1 = (h-foregroundImage.getHeight())/2;
            g.drawImage(foregroundImage, x1, y1, null);
        public static void main(String[] args) throws IOException {
            URL url1 = new URL("http://weblogs.java.net/jag/Image54-large.jpeg");
            URL url2 = new URL("http://weblogs.java.net/jag/DukeSaltimbanqueSmall.jpeg");
            JComponent comp = new Example(ImageIO.read(url1), ImageIO.read(url2));
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(comp);
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Export with Transparent Background

    I do realize this has been asked again and again.  Just making a reality check. I created a lower third. Time and time again the import into Final Cut Pro was on a solid black background instead of a transparency.
    I followed every post and followed the directions - with no success.
    Finally I exported my Motion lower third as a Template.  The effect appears as a Generator in Final Cut.  When I use the created Generator in my timeline the lower third has a proper transparency and works properly.
    Is that really the only way to import a Motion graphic with transparent background??     Yes, I did try creating a Movie in ProRes 4444, my project does have a transparent background selected, etc.  I feel as if I am missing something.

    Much appreciated  :-)
    I purchased the lower third from Videohive.  It has the basic graphic but lacks titles. While I was watching Motion tuturials, I thought I would customize the lower third with a fancy text animation.
    I tried a few experiments based on what you said.  I see now.
    So it appears that even though my proxy media lacks the alpha channel and does not display with a transparency, the moment I switch FCP to view Optimized/Original media, the transparency works correctly. 
    So I assume I can still use proxy media (if needed) and ignore the lack of transparency until my final render.  As long as I am exporting from Motion using ProRes 4444 it should work correctly.
    Does that reasoning make sense?
    Looking at many posts across the internet, I think this is the very issue that has tripped up many people.
    Thank you for your helpful comment. I was going nuts trying to figure it out.

  • Images with transparent backgrounds in MDM

    I've got several images in MDM with transparent backgrounds, yet when i look at these in image manager (or thumbnails in data manager) they look terrible. The transparency is black for example, among other issues. These images are all okay in photoshop, they have been saved as .png and imported through the data manager.
    Has this import ruined these image files on the way in? When my search engines etc extract the images, what of the transparencies?

    Hi Adam,
    MDM makes use of Internet Explorer quite frequently. I can imagine that this engine is also used to display images in MDM. However, Internet Explorer in version 6 does not support transparency in PNG images. That is why the black background occurs.
    Since your images after upload are only saved in a binary object in the database, you should not encounter any data loss when using the same images. If you need to create variants, I would consider using Photoshop for the creation of those.
    I hope that helps you further.
    Best regards
    Christian

Maybe you are looking for

  • I am filling out a pdf but the send button won't work. why?

    I created a fillable PDF in Acrobat 9 pro and sent it out as a test to my email. I filled it out and pressed the send button but it does not work. I updated Adobe reader to version 10. Still nothing... anyone know what's wrong?

  • Transferring an existing web name to web.mac,com/username

    My current web page host needs the IP address of my web.mac.com/username in order to update the DNS server. How can I get this IP address? Thanks.

  • How can I get a second email adress?

    I need a additional email adress with my apple account. How do I get one? -without cost? -with cost? Thanks for your support. Freddy

  • How do I edit a converted Word doc?

    I just subscribed to Adobe Acrobat.  I converted a Word document to PDF.  I was hoping to be able to edit, move pictures around, change layout, add captions, etc.  Is this going to be possible?

  • Moving Elements 6 to a new computer

    Hello - I purchased Photoshop Elements 6 for Macintosh a few years ago, and have now purchased a new Apple computer.  How can I install Elements on the new computer?  I tried copying the program but (predictably) it does not allow this.  I've also lo