Creating Transparent Images

I need to create a 10 X 10 transparent gif image (entirely transparent). I would imagine that this would be fairly simple but I don't know how to get started. Does anyone have any ideas? Thanks.

Another way to have a transparent Icon:
public class TransparentIcon implements javax.swing.Icon {
   private int h = 10;
   private int w = 10;
   public TransparentIcon() {
      super();
   public TransparentIcon(int w, int h) {
      super();
      this.h = h;
      this.w = w;
   public int getIconHeight() { return h; }
   public int getIconWidth() { return w; }
   public void paintIcon(Component c, Graphics g, int x, int y) {
      // do nothing
}

Similar Messages

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • Manage stamps can no longer create transparent images

    I created a dozen transparent stamps from TIFF and GIF images using Photoshop.
    They all worked fine until very recently. Now when I try to create transparent stamps with Manage Stamps, it puts a solid background - no transparency even with images that previously worked.
    Existing Transparent stamps when opened in Manage Stamps also lose transparency (if saved).
    PDF format transparencies work with Manage Stamps but quality not as good as TIFF.
    Not sure if a recent upgrade to Acrobat or Adobe CS5 or removal of Macromedia CS5 caused this - perhaps some common library got corrupted or removed.
    Cannot find any clue about this with Google Search or anywhere within Adobe.
    Any help/hint would be appreciated.

    You need to switch to the old "Options" page, by going to Other and the end of the left pane there. Or directly via this link:
    https://outlook.office365.com/ecp/?rfr=owa&owaparam=modurl%3D0&p=account

  • Create transparency image from shape

    Hi,
    I'd like to create the application that create the transparency image from drawing data. the code is as follows.
    BufferedImage img = new BufferedImage(350,350,BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = img.createGraphics();
    GeneralPath gp = new GeneralPath(GeneralPath.WIND_NON_ZERO);
    gp.moveTo(100,100);     gp.lineTo(100,200);
    gp.lineTo(200,200);     gp.lineTo(200,100); gp.closePath();
    g2.setPaint(Color.yellow);
    g2.fill(gp);
    g2.setStroke(new BasicStroke(2));
    g2.setPaint(Color.red);
    g2.draw(gp);
    File outFile = new File("outimg.png");
    ImageIO.write(img,"png",outFile);
    I can create the image from such code, but the image is not transparent since the background is all black. What additional coding I need to make it transparent?
    Thanks,
    Sanphet

    1. use a PixelGrabber to convert the image into a pixel array
    2. (assuming pixel array called pixelArray) :
    if (pixelArray[loopCounter] == 0xFFFFFFFF) { //assuming the black your seeing is not a fully transparent surface
        pixelArray[loopCounter] = pixelArray[loopCounter] & 0x00FFFFFF; //sets alpha channel for all black area to 0, thus making it fully transparent
    }3. recreate an Image using MemoryImageSource
    I'm sure there is a quicker solution using some built in java functions...but hey, I dont' know it!! :)
    Here's a sample class that utilizes these techniques:
    * To start the process, click on the window
    * Restriction (next version upgrade) :
    *     - firstImage must be larger
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class AdditiveBlendingTest extends javax.swing.JFrame implements MouseListener, ActionListener, WindowListener {
        static final int ALPHA = 0xFF000000; // alpha mask
        static final int MASK7Bit = 0xFEFEFF; // mask for additive/subtractive shading
        static final int ZERO_ALPHA = 0x00FFFFFF; //zero's alpha channel, i.e. fully transparent
        private Image firstImage, secondImage, finalImage; //2 loades image + painted blended image
        private int firstImageWidth, firstImageHeight, secondImageWidth, secondImageHeight;
        private int xInsets, yInsets; //insets of JFrame
        //cliping area of drawing, and size of JFrame
        private int clipX = 400;
        private int clipY = 400;
        //arrays representing 2 loades image + painted blended image
        private int[] firstImageArray;
        private int [] secondImageArray;
        private int [] finalImageArray;
        //system timer, used to cause repaints
        private Timer mainTimer;
        //used for double buffering and drawing the components
        private Graphics imageGraphicalSurface;
        private Image doubleBufferImage;
        public AdditiveBlendingTest() {
            firstImage = Toolkit.getDefaultToolkit().getImage("Image1.jpg");
            secondImage = Toolkit.getDefaultToolkit().getImage("Image2.gif");
         //used to load image, MediaTracker process will not complete till the image is fully loaded
            MediaTracker tracker = new MediaTracker(this);
            tracker.addImage(firstImage,1);
         try {
             if(!tracker.waitForID(1,10000)) {
              System.out.println("Image1.jpg Load error");
              System.exit(1);
         } catch (InterruptedException e) {
             System.out.println(e);
         tracker = new MediaTracker(this);
         tracker.addImage(secondImage,1);
         try {
             if(!tracker.waitForID(1,10000)) {
              System.out.println("Image2.gif Load error");
              System.exit(1);
         } catch (InterruptedException e) {
             System.out.println(e);
         //calculate dimensions
         secondImageWidth = secondImage.getWidth(this);
         secondImageHeight = secondImage.getHeight(this);
         firstImageWidth = firstImage.getWidth(this);
         firstImageHeight = firstImage.getHeight(this);
         //creates image arrays
         firstImageArray = new int[firstImageWidth * firstImageHeight];
            secondImageArray = new int[secondImageWidth * secondImageHeight];
         //embeded if statements will be fully implemented in next version
         finalImageArray = new int[((secondImageWidth >= firstImageWidth) ? secondImageWidth : firstImageWidth) *
                 ((secondImageHeight >= firstImageHeight) ? secondImageHeight : firstImageHeight)];
         //PixelGrabber is used to created an integer array from an image, the values of each element of the array
         //represent an individual pixel.  FORMAT = 0xFFFFFFFF, with the channels (FROM MSB) Alpha, Red, Green, Blue
         //each taking up 8 bits (i.e. 256 possible values for each)
         try {
             PixelGrabber pgObj = new PixelGrabber(firstImage,0,0,firstImageWidth,firstImageHeight,firstImageArray,0,firstImageWidth);
             if(pgObj.grabPixels() && ((pgObj.getStatus() & ImageObserver.ALLBITS) != 0)){
         } catch (InterruptedException e) {
             System.out.println(e);
         try {
             PixelGrabber pgObj = new PixelGrabber(secondImage,0,0,secondImageWidth,secondImageHeight,secondImageArray,0,secondImageWidth);
             if (pgObj.grabPixels() && ((pgObj.getStatus() & ImageObserver.ALLBITS) !=0)) {
         } catch (InterruptedException e) {
             System.out.println(e);
         //adds the first images' values to the final painted image.  This is the only time the first image is involved
         //with the blend
         for(int cnt = 0,large = 0; cnt < (secondImageWidth*secondImageHeight);cnt++, large++){
             if (cnt % 300 == 0 && cnt !=0){
              large += (firstImageWidth - secondImageWidth);
             finalImageArray[cnt] = AdditiveBlendingTest.ALPHA + (AdditiveBlendingTest.ZERO_ALPHA & firstImageArray[large]) ;
         //final initializing
         this.setSize(clipX,clipY);
         this.enable();
         this.setVisible(true);
         yInsets = this.getInsets().top;
         xInsets = this.getInsets().left;
         this.addMouseListener(this);
         this.addWindowListener(this);
         doubleBufferImage = createImage(firstImageWidth,firstImageHeight);
         imageGraphicalSurface = doubleBufferImage.getGraphics();
        public void mouseEntered(MouseEvent e) {}
        public void mouseExited(MouseEvent e) {}
        public void mousePressed(MouseEvent e) {}
        public void mouseReleased(MouseEvent e) {}
        public void windowActivated (WindowEvent e) {}
        public void windowDeiconified (WindowEvent e) {}
        public void windowIconified (WindowEvent e) {}
        public void windowDeactivated (WindowEvent e) {}
        public void windowOpened (WindowEvent e) {}
        public void windowClosed (WindowEvent e) {}
        //when "x" in right hand corner clicked
        public void windowClosing(WindowEvent e) {
         System.exit(0);
        //used to progress the animation sequence (fires every 50 ms)
        public void actionPerformed (ActionEvent e ) {
         blend();
         repaint();
        //begins animation process and set's up timer to continue
        public void mouseClicked(MouseEvent e) {
         blend();
         mainTimer = new Timer(50,this);
         mainTimer.start();
         repaint();
         * workhorse of application, does the additive blending
        private void blend () {
         int pixel;
         int overflow;
         for (int cnt = 0,large = 0; cnt < (secondImageWidth*secondImageHeight);cnt++, large++) {
             if (cnt % 300 == 0 && cnt !=0){
              large += (firstImageWidth - secondImageWidth);
             //algorithm for blending was created by another user, will give reference when I find
             pixel = ( secondImageArray[cnt] & MASK7Bit ) + ( finalImageArray[cnt] & MASK7Bit );
             overflow = pixel & 0x1010100;
             overflow -= overflow >> 8;
             finalImageArray[cnt] = AdditiveBlendingTest.ALPHA|overflow|pixel ;
         //creates Image to be drawn to the screen
         finalImage = createImage(new MemoryImageSource(secondImageWidth, secondImageHeight, finalImageArray,
              0, secondImageWidth));
        //update overidden to eliminate the clearscreen call.  Speeds up overall paint process
        public void update(Graphics g) {
         paint(imageGraphicalSurface);
         g.drawImage(doubleBufferImage,xInsets,yInsets,this);
         g.dispose();
        //only begins painting blended image after it is created (to prevent NullPointer)
        public void paint(Graphics g) {
         if (finalImage == null){
             //setClip call not required, just added to facilitate future changes
             g.setClip(0,0,clipX,clipY);
             g.drawImage(firstImage,0,0,this);
             g.drawImage(secondImage,0,0,this);
         } else {
             g.setClip(0,0,clipX,clipY);
             g.drawImage(finalImage,0,0,this);
        public static void main( String[] args ) {
         AdditiveBlendingTest additiveAnimation = new AdditiveBlendingTest();
         additiveAnimation.setVisible(true);
         additiveAnimation.repaint();

  • Can i use iphoto to create transparent images?

    I would like to know if there is any way to edit my images on iPhoto to have a transparent background. I need to upload photos to a website, but I do not want there to be a white "shadow" around my images. I know you can do it with Photoshop, but can you do it easily with iPhoto?

    No. But the Instant Alpha feature in Preview or Pages will do this for you. Image editors like Acorn have this as well. Remember to save the files as png or other, as jpeg doesn't support transparency.
    Regards
    TD

  • What program uses to create transparent images?

    I use paint shop pro 5, selecting the zone of image that the program must show,
    and saving it as alfa channel.
    But in Samsung E800 it does not funcion, it shows images in a rectangle.
    Perhaps could be because paint shop pro is too old?
    what program use you?

    Are you sure the device supports transparant PNG?
    Try putting the image in an html page with a coloured background and view it in a non IE browser (mozilla, firefox for example). If you have transparancy, the PNG is ok, and you know that it's the device.

  • How do I create a transparent image (cutout) on top of a solid one?

    Hello. I am trying to use Pathfinder>Minus front to create transparent rays over text outlines, but am having trouble. Here is a link to how it should appear: http://graphicmechanic.com/IMAGES/ingen.png. It's nearly exactly how I'd like it to look but i just want it so that when I put the graphic on an image the rays don't show up as white but are instead transparent.

    So you want them transparent or just gone?
    If the latter:
    Make a compound path from the rays, then copy the text shape and paste in front of all (it's outlined, isn't it?). The letters also need to be a compound path.
    Then select the text copy and the rays, take the pathfinder panel and subtract.

  • Problem in creating 1 image using differnt images

    Dear Fellows I want to create an image by using different images in byte array format. Images may be transparent or normal images. I want final result in byte array. I am using the following technique which is working fine but the problem with this technique is that it takes too much time to create an image. This is because I am using MediaTraker. If I delete the code of MediaTracker then program have undeterministic behavior i.e, sometimes it create the final image properly and sometimes nothing is displayed in final image.
    I need some help from you. If anyone of you know the technique to draw image using different images without using mediaTracker kindly let me know.
    Early replies will be appreciated
    // here is the sample code which i m using for creating image
    byte[] backgroundImage= // read 800 X 600 image from disk and convert it in to byte array
    byte[] image1 = // read 200 X 200 image from disk and convert it in to byte array
    byte[] transparentImage // read 300 X 300 transparent image from disk and convert it in to byte array
    Image img=null;
    Frame frame =new Frame();
    frame.addNotify();
    //creating BufferedImage object to store Final image
    BufferedImage requiredImage= new BufferedImage(800,600,BufferedImage.SCALE_SMOOTH);
    //get Graphics of BufferedImage created above
    Graphics2D g=(Graphics2D) requiredImage.getGraphics();
    ///// begin draw back ground image
    img=Toolkit.getDefaultToolkit().createImage(backgroundImage);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw background starting from x=0, y=0 with 800 X 600 dimentions
    g.drawImage(img,0,0,800,600,null);
    ////////// end draw background image
    ////////// begin draw image1
    img=Toolkit.getDefaultToolkit().createImage(image1);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw image1 starting from x=10, y=10 with 200 X 200 dimentions
    g.drawImage(img,10,10,200,200,null);
    //////////// end draw image1
    //////begin transparentImage
    img=Toolkit.getDefaultToolkit().createImage(backData);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw transparentImage starting from x=400, y=0 with 300 X 300 dimentions
    g.drawImage(img,400,0,300,300,null);
    ///end draw transparent image
    byte []finalResult = //convert requiredImage into byte array;
    you can mail me the solution on my email address [email protected]
    thanks with best regards
    and waiting for someone to reply
    kamran zameer

    is there anyone on this forum to help me??????
    regards,
    kamran zameer

  • Using Transparent Images in DW CS3

    I am new to DreamWeaver and would like to know the best type
    of image to use when transparency is desired. I have tried png
    files but they don't work in anything but IE7 without the fix that
    you have to add to CSS for every image. When I use a gif it is
    never transparent. When I post it there is white where the
    transparent should be. I know that this is an old issue and I have
    been reading alot in these forums but I want to know what the
    professionals do so I don't have to spend 48 hours with trial and
    error. Can anyone share their expert konwledge? Please!?

    Set the image transparency before you save the image (look
    for the selection
    list in the Optimize panel in FW).
    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
    ==================
    "robweed7" <[email protected]> wrote in
    message
    news:flh3i3$dtu$[email protected]..
    >I have used A-CS3's Fireworks, Illustrator, and Photoshop
    to create gif
    >images. I make an image with a transparent canvas and
    then save it as a
    >gif. Is there another step I should be doing?

  • Colors shift when a PDF file contains transparent image

    Hello,
    I tried to programatically set a soft mask to an image by using the Addobe PDF Library, in order to make part of the image transparent. The image color space is RGB. I used PDEImageSetSMask() funtcion for setting the mask. I also have a PDF file that was created in the same way but without the part of the code that sets the mask. Therefore this PDF contains the same image as not transparent.
    When I open two files in Adobe Reader 9.2.0 the colors are not the same. The colors in the file which contains the transparent image are a bit darker. The colors are different not only inside the image box, but in all page area. I also tried to open the same file in GSView and there was no such problem.
    Can I fix this by changing the Adobe reader preferences, or this is a problem in the code that genereates the PDF?
    If this is not the correct forum to ask this question, please direct me to the correct forum
    Thanks

    You need to set the transparency blending space of the page to RGB, since the default blending space is CMYK (hence the color shift).  You do this by adding a transparency group dictionary to the page's dictionary when creating the PDF.

  • Create Thumbnail Image in JSP

    I have JSP a page, were I want to show Thumbnail Image from specified path. The specified path contain one or more file. If anybody have the code or reference for doing this please replay. (For one image will also the helpfule for me)
    Thank You

    The following is what I use to create thumbnail images. It uses struts, is a bit of a haste work but never failed in creating thousands of thumbnails. I'd be glad if you suggest improvement.
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import org.apache.struts.upload.FormFile;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import org.apache.log4j.Logger;
    * @author Niklas
    public class ClassifiedImage {
        Logger log = Logger.getLogger(this.getClass());
        /** Creates a new instance of ClassifiedImage */
        public ClassifiedImage() {
        public void generateImage(FormFile file, String outputFilename, String outputthumbFilename) {
            try {
                String type = file.getContentType();
                String name = file.getFileName();
                int size = file.getFileSize();
                byte[] data = file.getFileData();
                if (data != null && name.length() > 0) {
                    ByteArrayInputStream bis = new ByteArrayInputStream(data);
                    BufferedImage bi = ImageIO.read(bis);
                    int width = bi.getWidth();
                    int height = bi.getHeight();
                    Image thumb = null;
                    if (width > 600 || height > 600) {
                        Image scaledimage = null;
                        if (width > 600) {
                            scaledimage = bi.getScaledInstance(600, -1, Image.SCALE_SMOOTH);
                            thumb = bi.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImage = StrutsUploadAction.toBufferedImage(scaledimage);
                            BufferedImage thumbBuffImage = StrutsUploadAction.toBufferedImage(thumb);
                            int newWidth = scaledBuffImage.getWidth();
                            int newHeight = scaledBuffImage.getHeight();
                            int thumbBuffImagenewWidth = thumbBuffImage.getWidth();
                            int thumbBuffImagenewHeight = thumbBuffImage.getHeight();
                            if (thumbBuffImagenewHeight > 60) {
                                thumb = thumbBuffImage.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            if (newHeight > 600) {
                                scaledimage = scaledBuffImage.getScaledInstance(-1, 600, Image.SCALE_SMOOTH);
                            BufferedImage scaledthumbBuffImage = StrutsUploadAction.toBufferedImage(thumb);
                            BufferedImage scaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage);
                            int newWidth2 = scaledBuffImage2.getWidth();
                            int scaledNewHeight = scaledBuffImage2.getHeight();
                            String formatName = "jpg"; // desired format
                            File outputFile = new File(outputFilename);
                            File outputthumbfile = new File(outputthumbFilename);
                            if (width > 600 || newHeight > 600) {
                                boolean writerExists = ImageIO.write(scaledBuffImage2, formatName, outputFile);
                                boolean writerthumbExists = ImageIO.write(scaledthumbBuffImage, formatName, outputthumbfile);
                        } else if (height > 600) {
                            Image scaledimage2 = bi.getScaledInstance(-1, 600, Image.SCALE_SMOOTH);
                            thumb = bi.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage2);
                            int newWidth2 = scaledBuffImage2.getWidth();
                            int newHeight2 = scaledBuffImage2.getHeight();
                            BufferedImage scaledthumbBuffImage2 = StrutsUploadAction.toBufferedImage(thumb);
                            int newthumbWidth2 = scaledthumbBuffImage2.getWidth();
                            int newthumbHeight2 = scaledthumbBuffImage2.getHeight();
                            if (newWidth2 > 600) {
                                scaledimage2 = scaledBuffImage2.getScaledInstance(600, -1, Image.SCALE_SMOOTH);
                            if (newthumbWidth2 > 80) {
                                thumb = scaledthumbBuffImage2.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage ndscaledBuffImage2 = StrutsUploadAction.toBufferedImage(scaledimage2);
                            BufferedImage ndscaledthumbBuffImage2 = StrutsUploadAction.toBufferedImage(thumb);
                            int n_newWidth2 = ndscaledBuffImage2.getWidth();
                            int n_newHeight2 = ndscaledBuffImage2.getHeight();
                            String formatName2 = "jpg"; // desired format
                            File outputFile2 = new File(outputFilename);
                            File outputfile3 = new File(outputthumbFilename);
                            if (height > 600 || newHeight2 > 600) {
                                boolean writerExists2 = ImageIO.write(ndscaledBuffImage2, formatName2, outputFile2);
                                boolean writerExists3 = ImageIO.write(ndscaledthumbBuffImage2, formatName2, outputfile3);
                    } else {
                        FileOutputStream fileOut = new FileOutputStream(outputFilename);
                        fileOut.write(data);
                        fileOut.flush();
                        fileOut.close();
                        BufferedImage b = null;
                        ByteArrayInputStream bi2 = new ByteArrayInputStream(data);
                        BufferedImage bufi2 = ImageIO.read(bi2);
                        int width2 = bi.getWidth();
                        int height2 = bi.getHeight();
                        Image thumbnail2 = null;
                        if (height2 > width2) {
                            thumb = bufi2.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            BufferedImage scaledBuffImagethumb = StrutsUploadAction.toBufferedImage(thumb);
                            int newWidth7 = scaledBuffImagethumb.getWidth();
                            int newHeight7 = scaledBuffImagethumb.getHeight();
                            if (newWidth7 > 80) {
                                thumb = scaledBuffImagethumb.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            b = StrutsUploadAction.toBufferedImage(thumb);
                        } else {
                            thumb = bufi2.getScaledInstance(80, -1, Image.SCALE_SMOOTH);
                            BufferedImage scaledthumb = StrutsUploadAction.toBufferedImage(thumb);
                            int scaledthumbwidth = scaledthumb.getWidth();
                            int scaledthumbheight = scaledthumb.getHeight();
                            if (scaledthumbheight > 60) {
                                thumb = scaledthumb.getScaledInstance(-1, 60, Image.SCALE_SMOOTH);
                            b = StrutsUploadAction.toBufferedImage(thumb);
                        File f = new File(outputthumbFilename);
                        boolean bo = ImageIO.write(b, "jpg", f);
            } catch (Exception e) {
                log.error(e.getMessage(), e);
    }And the helper method:
    // This method returns a buffered image with the contents of an image
        public static BufferedImage toBufferedImage(Image image) {
            if(image instanceof BufferedImage) {
                return (BufferedImage)image;
            // This code ensures that all the pixels in the image are loaded
            image = new ImageIcon(image).getImage();
            // Determine if the image has transparent pixels; for this method's
            // implementation, see e661 Determining If an Image Has Transparent Pixels
            boolean hasAlpha = false;
            // Create a buffered image with a format that's compatible with the screen
            BufferedImage bimage = null;
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            try {
                // Determine the type of transparency of the new buffered image
                int transparency = Transparency.OPAQUE;
                if(hasAlpha) {
                    transparency = Transparency.BITMASK;
                // Create the buffered image
                GraphicsDevice gs = ge.getDefaultScreenDevice();
                GraphicsConfiguration gc = gs.getDefaultConfiguration();
                bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
            } catch(HeadlessException e) {
                // The system does not have a screen
            if(bimage == null) {
                // Create a buffered image using the default color model
                int type = BufferedImage.TYPE_INT_RGB;
                if(hasAlpha) {
                    type = BufferedImage.TYPE_INT_ARGB;
                bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
            // Copy image to buffered image
            Graphics g = bimage.createGraphics();
            // Paint the image onto the buffered image
            g.drawImage(image, 0, 0, null);
            g.dispose();
            return bimage;
        }

  • Transparent image causes flattening problem

    Hi,
    I have a 34 page booklet that I am exporting as a swf file. When I add a transparent png file to the booklet (it makes the book look like it has a spiral binding) the file will NOT export anymore. It gets to page 17, quits and the error message says something like, "there was an error while flattening".
    I can get the file to export if I check rasterize the images in the export dialog box. Just for added information, I did change the transparent png into a gif file and tried exporting that but I received the same error message. If you want to see the file it is located here
    http://www.sportop.com/flip-catalog/ThunderRidgeResortApparel.html
    It is the spiral image that causes the problem. Any ideas why this is happening?
    P.S. It looks like nothing is happening while the file is loading because I do not know how to add a pre-loader (my other problem).
    One more thing, any idea why the file does NOT center is the html container page?
    Thank you for your help,
    Tricia

    Sounds strange, I have used a lots of transparent images in INDD layouts and exported them as SWF succesfully. Have you tried to use Photoshop PSD-format? And you could also create a new layer for that spiral...
    If you want to get your book centered and equipped with preloader, go to Adobe Marketplace and download eDocker:
    http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.offering&offeringid=1 7503&marketplaceid=1
    You may use it for couple of days free of charge!
    If you have your SWF exported and ready, it takes only about 20 seconds to build a version with preloader and many other cool stuff too, like zooming...

  • Layering a series of Transparent images onto a JPanel or JLayeredPane

    Hello all -
    I am working on creating a viewfinder type component for a game engine I am developing. Currently, I am loading a BackBuffered image from an array and displaying it in a JPanel. This image essentially serves as the "background" of the viewfinder.
    What I would like to do is go one step further and after the background image is determined, load a series of transparent images and place those on top of the background, BEFORE the repaint() method is called. An example of this would be loading the background image, and then loading walls (or other sprites), firing the repaint() method, resulting in the rendering all the images at one time.
    I have looked into JLayeredPane, but am uncertain as to whether this is the correct avenue to pursue. Does anyone have any experience with this?
    Any assistance would be greatly appreciated.

    JLayeredPane is not the way to go. Just draw your images on a panel. If you want/need to do all the drawing before repainting, use a back buffer. See BufferedImage

  • Creating transparent logos help?

    Hi,
    I've been working through this tutorial
    http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/pscs5-creating-transpar ent-logos-for-watermarks-and-overlays-in-photoshop/
    But as I have upgraded to Photoshop CC I am having a few issues.
    I have done everything in the tutorial, but when I come to use my custom shape if I just click on my image a pop up box appears that says 'Create custom shape' with boxes to fill in the pixel sizes, and two check boxes 'from centre or preserve proportions'.
    If I click and drag this box doesn't come up, instead the custom shape is put down ok but the little path squares are on. If I click on a different layer they go away, but when I click on the shape layer they come back again! How do I make it so that my custom shape appears like a normal image?
    I've got shape selected in the drop down box.
    I have just discovered the properties box, if I click on the shape path it changes to the normal shape, is there a way to make that the default?
    I also want to apply the layer style and have tried saving a new tool preset. But the layer style won't save on it. Any ideas what I am doing wrong?
    Any tips greatly appreciated.

    The Goblin wrote:
    Hi,
    I've been working through this tutorial
    http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/psc s5-creating-transparent-logos-for-watermarks-and-overlays-in-photoshop /
    But as I have upgraded to Photoshop CC I am having a few issues.
    I have done everything in the tutorial, but when I come to use my custom shape if I just click on my image a pop up box appears that says 'Create custom shape' with boxes to fill in the pixel sizes, and two check boxes 'from centre or preserve proportions'.
    If I click and drag this box doesn't come up, instead the custom shape is put down ok but the little path squares are on. If I click on a different layer they go away, but when I click on the shape layer they come back again! How do I make it so that my custom shape appears like a normal image?
    I've got shape selected in the drop down box.
    I have just discovered the properties box, if I click on the shape path it changes to the normal shape, is there a way to make that the default?
    I also want to apply the layer style and have tried saving a new tool preset. But the layer style won't save on it. Any ideas what I am doing wrong?
    Any tips greatly appreciated.
    When you click on the document without dragging, the pop up appears as it want to know what size the shape should be at that location. Thats why it does not appear when you drag, as that drag tells photoshop what size the shape should be.
    What I think maybe happening, is you have the custom shape tool set to path instead of shape. In the top tool bar on the left side of the screen you will see (second icon in) a drop box or 3 icons (depending on your version) If a drop box click it and select shape, if 3 icons click the left icon not the middle or right.
    The shape option is also the default, so if you can not figure it out you can click right click on the very first icon in the top tool bar and select reset tool or reset all tools.
    Layer style do not save in the tool presets, those presets are for the tools not the object. What you need to do is open the styles panel (window>style) Then save your preset there. Either click on the new icon at the bottom of the styles panel or click inside the panel.

  • Which Type of Transparency Image File

    Hello
    I was wondering if anyone has ever tried creating an image with it's background carefully traced and removed, then saving that edited image into a transparency, and then of course importing it into the FCE timeline superimposed over the main video track?
    I've got Adobe Photoshop 7, and I was wondering what the edited (cropped), transparent image file should be saved to?
    Thanx
    Mike

    Hi Thanx Matt
    Ok then as I understand it, the completed (edited), image after cropping (removal of the background), must be saved as just a .psd adobe project file, and NOT exported as any other file type.
    Now unless I'm missing something, you say that this psd will definitely open in FCE HD (just as a psd).
    Correct?
    And then this psd transparent file will allow video background to appear superimposed under/over it.
    Correct?
    And of course you can change the opacity of either the video, or the inserted psd according to the desired effect.
    Now Matt, does one need to have Photo Shop installed in the same computer system that has FCE HD installed?
    Or can I get a friend to create the transparent psd from her adobe program, then just transfer it into my system with FCE.
    (Currently I don't have Photoshop installed in my system)
    Thanx Matt

Maybe you are looking for