Transparent color in an Image.

I have an image that has white as it transparent color. How can I draw everything thing but white? Any help would be great.
Thanks.

I think you might be able to do it with a RGBImageFilter. The filter RGB would simply return the passed in RGB value for any color other then white, and return a zero if the rgb values match the color you want to make transparent. Look through the API for instructions on how to use it.

Similar Messages

  • How get transparent index for indexed image?

    Hello,
    In my fileformat plugin on writing I can't get transparent
    color for indexed image. For RGB
    image I got transparent data from alfa channel in data of FormatRecord.
    The FormatRecord structure has value
    transparentIndex (for GIF), but it always =0
    (even, if in the image transparent index=12, for example).
    How can I get transparent index? Or, if it possible, how get transparent
    data for indexed image in alfa channel?

    Hello,
    In my fileformat plugin on writing I can't get transparent
    color for indexed image. For RGB
    image I got transparent data from alfa channel in data of FormatRecord.
    The FormatRecord structure has value
    transparentIndex (for GIF), but it always =0
    (even, if in the image transparent index=12, for example).
    How can I get transparent index? Or, if it possible, how get transparent
    data for indexed image in alfa channel?

  • Loss of the transparent color in images inserted into Draw

    I need to float an oval portrait image over a background image, so to get to the oval I made the portrait image corner sections transparent using Graphic Converter and saving as a PNG, which supports the transparent color. Problem is that after the PNG image is inserted into the Draw document containing the background image, the transparent sections are black and not transparent. Anyone else know about this problem?

    Welcome to Apple Discussions Jim
    I've not had much success, & none recently, getting images to be transparent in AppleWorks. However, a few years ago I accidentally discovered that if the image is flipped or rotated the background will become transparent. Since you are using Graphic Converter, you can do what I did. Before saving the image in Graphic Converter flip it horizontally so that once imported into your AppleWorks document you can "re-flip" it & the background will be transparent. Another option is to rotate the object 1 degree in AppleWorks.
    I now use Pages for my desktop publishing & it has no problem with transparent PNG or GIF images.
    Peggy

  • Setting a specific color on a image transparent

    I want to take a image that im drawing in the paint(graphics g) method, and set a certain color on that image transparent. so it blends with the background image properly.
    any ideas would be appreciated.

    Bird.gif
    import java.awt.*;
    import java.awt.image.*;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class TransparencyTest extends JPanel
        BufferedImage image;
        public TransparencyTest(BufferedImage orig)
            Color toErase = new Color(248, 248, 248, 255);
            image = eraseColor(convertImage(orig), toErase);
            setBackground(Color.pink);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            int x = (w - image.getWidth())/2;
            int y = (h - image.getHeight())/2;
            g.drawImage(image, x, y, this);
        private BufferedImage convertImage(BufferedImage in)
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            BufferedImage out = gc.createCompatibleImage(in.getWidth(), in.getHeight(),
                                                         Transparency.TRANSLUCENT);
            Graphics2D g2 = out.createGraphics();
            g2.drawImage(in, 0, 0, this);
            g2.dispose();
            return out;
        private BufferedImage eraseColor(BufferedImage source, Color color)
            int w = source.getWidth();
            int h = source.getHeight();
            int type = BufferedImage.TYPE_INT_ARGB;
            BufferedImage out = new BufferedImage(w, h, type);
            Graphics2D g2 = out.createGraphics();
            g2.setPaint(new Color(0,0,0,0));
            g2.fillRect(0,0,w,h);
            int target = color.getRGB();
            for(int j = 0; j < w*h; j++)
                int x = j % w;
                int y = j / w;
                if(source.getRGB(x, y) == target)
                    source.setRGB(x, y, 0);
            g2.drawImage(source, 0, 0, this);
            g2.dispose();
            return out;
        public static void main(String[] args) throws IOException
            String path = "images/Bird.gif";
            BufferedImage bi = ImageIO.read(TransparencyTest.class.getResource(path));
            TransparencyTest test = new TransparencyTest(bi);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • Export image from Flash to .ai or .eps and keep transparent colors.

    Is there a way to, when I have finished this wonderful
    drawing in Flash with transparent colors, to keep them when I
    export them from Flash to Illustrator as an .ai or .eps?
    I'd like my images to be scalable and rezizable (to be able
    to be really BIG) when I deliver them.
    Please help! I use Flash MX and Illustrator CS.
    Lisa

    > Is there a way to, when I have finished this wonderful
    drawing in Flash with
    > transparent colors, to keep them when I export them from
    Flash to Illustrator
    > as an .ai or .eps?
    What happens when you import them into Illustrator?
    Christian Scholz-Flöter

  • How to superpose two image with transparency color

    Hi,
    I like to superpose two image with a transparency color. I know it is possible but i do not know on which API i can find it.
    thanks

    http://developer.java.sun.com/developer/JDCTechTips/2002/tt0618.html
    http://java.sun.com/products/jfc/tsc/articles/swing2d/
    Try these they discuss transparent images.
    rykk

  • Filling the transparent color with a new color in an image

    Hi,
    I need to fill the transparent color of an imageicon with a new color.
    I tried building a filter, but i have no results.
    Here's my code:
    private static class TransparentColorFilter extends RGBImageFilter {
    private int transparentColor;
    private int newColor;
    public TransparentColorFilter(int transparentCol, int newCol) {
    canFilterIndexColorModel = true;
    transparentColor = transparentCol;
    newColor = newCol;
    public int filterRGB(int x, int y, int rgb) {
    if (rgb == transparentColor) {
    return newColor;
    return rgb;
    public static ImageIcon makeColoredIcon(ImageIcon icon, int color) {
    PixelGrabber pg = new PixelGrabber(icon.getImage(), 0, 0, 1, 1, false);
    try {
    pg.grabPixels();
    } catch (InterruptedException e) {
    return icon;
    IndexColorModel cm = (IndexColorModel)pg.getColorModel();
    int trans = cm.getTransparentPixel();
    if (trans == -1) return icon;
    return new ImageIcon(Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(icon.getImage().getSource(),new TransparentColorFilter(cm.getRGB(trans), color))));
    and the call is
    ColoredImageIcon c = new ColoredImageIcon();
    Color cc = Color.RED;
    ImageIcon newIcon = c.makeColoredIcon(myIcon, cc.getRGB());
    where myIcon is an IconImage.
    Where is wrong? I need to create a new ColorModel with no transparent pixel?

    10195331= 0x9B9183 in hexa notation if this helps.

  • How do you keep the colors of an image true when you set it as a background?

    I have an image with lines in it and a black blackground. When I set it as a background :
    html {
        background: url(../Images/backgroundimage.jpg);
        background-repeat:auto;
        background-position:center top;
    the black is a couple shades lighter so when I place a <div> with an <img>that is also mainly black on top of it, the top image is much darker than the background. I have no other css tags on the div other than a margin. The only difference in the images is I saved the background from photoshop and the image in the div from illustrator but I dont think that should have effected anything. Does anybody know anything about this because I am seriously stumped.
    Thanks

    We have been here before…
    Firstly, Adobe' Photoshop has the ability to save a color profile with an image. That color profile will be consistent across all versions of Adobe software. Problem is, Adobe does not make web browsers (and that is probably a good thing).
    When you save images for websites, you need to go through the proper Photoshop or Illustrator dialog. You want to Save for Web & Other Devices. Why? because the applications will take the image out of CMYK color space (if it is in that color space) and make it RGB. They will also try to translate the colors in a sensible way. When you use this dialog, you will see various options for JPG, including ICC Profile. Turning this on or off will change how the colors get mapped, and some experimentation to get best results is a good idea.
    I have it turned off, presently.
    The image will be set up for 72 dots per inch automatically, and you can, then, resize the image to optimize it for the website you are working on. If you are trying to fill a hole for an image that is 350 pixels wide by 250 tall, don't save the image as 1125 wide by 1024 high. That will take a long time to download from your server to whatever device is displaying it. Your original image will not be changed and you can navigate your path to your defined website's images folder.
    This should help you immeasurably. I should mention that If I am trying to match a background exactly, I will tend to knock out that color from the image, save the image as a .PNG file with transparency (where that particular color is) and place the image on the background in question with the background color I am trying to match on the website.
    -Mark

  • How to set transparency color in QT 7.0?

    Okay, I've been poking around the forums, searching and whatnot, and it looks like I can answer my own question [although please correct me if I'm wrong]: It's not possible, apparently, to set a transparency color for a video track in QT Pro 7.0. Despite the fact that it was easy in 6.0.
    (And they call this an 'upgrade'. Pfffah.)
    Well, I figure there must be a workaround, right? Some clever person out there has figured out a way to solve this, right?
    All I can think of is trying to run QT Player 6.0 on top of Tiger... it should work, at least according to what I've read in the forum. But I don't have Player 6.0 anymore (it conveniently disappeared when 7.0 was installed), and I can't find anywhere to download it from Apple's web site.
    Help, please!
    iBook G4   Mac OS X (10.4.4)  

    Yep. The Color Wheel is gone in version 7 but it still plays files that use a transparency color (those created in earlier versions).
    It also no longer allows you to edit MIDI Instruments, enable/disable mouse actions or set image overrides for sprite tracks.
    It's why I use both Pro versions on my Mac mini. You needed to "hide" the older version prior to installing Tiger.
    Sorry that I don't have an answer for your dilemma.

  • Distilling transparent colors from Word

    I have a color transparency in a Word document that renders in a dithered fashion when I create the corresponding PDF document. I have tried the various pre-defined settings (standard, high quality, and press quality) as well as disabling compression and all yield the same dithered result (Acrobat 9.2.0). Below is an example.
    The original image is on the left and the resulting PDF is on the right. Note that i can generate transparent colors from Illustrator using any of the redefined settings. Can anyone offer any suggestions? I assume it's an Acrobat print setting issue and i've tried a number of different setting compinations to no avail. Thanks

    Thanks for replying. I've tried using PDF Maker, but it consistently hangs during the process on any file that I've tried it on. (this is a new installation of Acrobat 9 Pro.) I've tried repairing with the installation disk, but I get the same result. So it looks like I need to resolve that problem first.

  • Levels adjusment to only selected colors in indexed image?

    I regularly have to adjust ranges of colors in indexed images. I usually use "Image -> Adjustments -> Replace color..." to do this since it effectively allows me to pick multiple color table entries and apply Hue, Saturation, and Lightness adjustments to them. What I could *really* use now and then, however, is the ability to apply a Levels adjustment to the selection. Unfortunately, I can only seem to apply a Levels adjustment to the whole indexed image, not just ranges of color table entries. I can't convert to RGB first because the color tables I end up with have to be applicable to the same image (the pixels in the image have to continue to reference the same color table index; converting to RGB and back breaks this association).
    Does anyone know if there's something I'm overlooking? The "Lightness" adjustment in the "Replace color..." tool just doesn't cut it for the level of adjustment I need.

    Here's a test I did.  First I created the rhinestone shape (rough shaped), with transparent background). I used a size of 30px and made a pattern of it.
    Then I took this photo and reduced it to the number of pixels that I wanted for each of the dots.  So in this case, I wanted 100 dots across the top, So I reduced the image to 100px wide.
    Then I converted it to index color with the five colors your wanted: white, black, red, yellow, and blue.
    After that, I converted back to RGB and upscaled it using nearest neighbor to keep the pixelated look.  I upscaled it so each pixel was my pattern size of 30px, so 3000%.
    Then I created a blank layer under this pixelated layer, and used the fill command using the pattern I created in the first image.  I clipped the pixelated layer to the fill layer, so that the colors would just show where my pattern had pixel values (round dots).  Then I set the pixelated layer's bend mode to overlay to get the look of a rounded dot.
    It looks a bit flat, but you can play with different patterns to get different looks.  I also put a solid black layer under everything to fill in the gaps between the dots.

  • Transparent Color

    I am very new to Photoshop and am I find it has so many bells and whistles that I can't get it to do anything I want it to so I'll be posting a lot of dumb questions here. I've found "search" to be of no help. And the tutorials I've checked out assume I know what they're talking about. You can just point me in the direction of an understandable help file, if one exists.
    I have scanned some .jpg images I want to use in a web page. The image I want is surrounded by white. There must be some way to make that white transparent so that on the web page the image displays without the white, i.e., the background color of the page surrounds the image.
    Heck! I don't even know how to properly pharse these questions. I hope someone can figure out what I'm trying to ask!
    Can do? How?
    Thanx,
    Mike

    Welcome to the world of Photoshop!
    I'm afraid you need to familiarize yourself with the basic terminology if you are going to understand the 1000s of tutorials. A good place to start is with the on-line Help files accessible by pressing F1. You have to realise that Photoshop is for graphics professionals. you might be better with Photoshop Elements which has step-by step guides to all the common tasks.
    You might find a basic beginners' book is a help too – you are never going to learn how to use the program properly by firing questions at this forum.
    For your current task, this entry from Photoshop Help is a lead-in:
    Transparency makes it possible to create nonrectangular images for the web. Background transparency preserves transparent pixels in the image. This allows the background of the web page to show through the transparent areas of your image. Background matting simulates transparency by filling or blending transparent pixels with a matte color that can match the web page background. Background matting works best if the web page background is a solid color and if you know what that color is.
    Use the Transparency and Matte options in the Save For Web & Devices dialog box to specify how transparent pixels in GIF and PNG images are optimized.
        * (GIF and PNG-8) To make fully transparent pixels transparent and blend partially transparent pixels with a color, select Transparency and select a matte color.
        * To fill fully transparent pixels with a color and blend partially transparent pixels with the same color, select a matte color and deselect Transparency.
        * (GIF and PNG-8) To make all pixels with greater than 50% transparency fully transparent and all pixels with 50% or less transparency fully opaque, select Transparency and select None from the Matte menu.
        * (PNG-24) To save an image with multilevel transparency (up to 256 levels), select Transparency. The Matte option is disabled since multilevel transparency allows an image to blend with any background color.
          Note: In browsers that do not support PNG-24 transparency, transparent pixels may be displayed against a default background color, such as gray.
    To select a matte color, click the Matte color swatch and select a color in the color picker. Alternatively, select an option from the Matte menu: Eyedropper Color (to use the color in the eyedropper sample box), Foreground Color, Background Color, White, Black, or Other (to use the color picker).
    Note: The Foreground Color and Background Color options are only available in Photoshop.

  • Type shifts color on overlapping images --Urgent, please!

    I just got proofs back and on most pages the type is shifting colors on overlapping images. I need some advice real quick. The type layer is on top of the image layer so it's not the usual case of rasterizing. However, here are some of the issues. This job came in Freehand, which had to be imported into Illustrator and from there into Indesign. Most of the type is therefore in outlines (ughh!). In addition, the type is CMYK with K=98.
    Is the CMYK type causing the issue?
    Is the fact that K is not 100% causing the issue? Would changing K to 100 solve the problem and stop the type from picking up whatever's underneath if indeed that's what's happening)?
    There is no transparency in the type, by the way. I double-checked.
    Thing is I can't see it on the screen at all. Only in the HP Laser proofs that the service bureau sent. So I can't test it! They say that it's just on the proofs and "not in the file." Is that possible?
    Any ideas? Suggestions/advice greatly appreciated.
    thanks,
    Scarlett

    Yup, it's small, about 12-13 point. Can't pinpoint exactly bc it came in as outlines.
    And all of the type is apart from the images. On a separate layer that sits above the images. No overprint. But quite a bit of overlap. Even when the type overlaps non-color, or the white parts (or "paper" color) of the image, it still produces these weird color shifts.
    So are you saying this is a printer issue, and, like my service bureau guy says, "it's not in the file" per se?
    Mind you, this still has to go to the printer! The service bureau just preps the files and sends proofs prior to the next step.
    Many thanks for your response.

  • How to replace a specific color with transparent color?

    I would need to get image of a control but I'd like to replace the background color of the control with transparent color (like the commentest image editor).
    I cannot use IMAQ library, so I would like to use 2D-picture palette.
    I can read the image data pixel per pixer, but.. once the color to be replaced is found, how to replace it with transparent?
    Thanks all

    It sounds like you want the "Create Mask.vi". If not, you might want to provide some code that shows what kind of situation you're dealing with.

  • Drawing Over Transparent Region of SplashScreen Image

    Has anyone been successful trying to paint over a transparent region of an image using the Java 6 SplashScreen ?
    I've got a PNG with a transparent background as my SplashScreen image, and I would like to paint over part of the transparent area. Whatever I try, I can't seem to accomplish it. I've played around with the Graphics2D setComposite and setClip, but I'm not having any luck. It paints over the non-transparent area, but not the transparent area. It's like there is a clip region for the image that I cannot seem to undo.
    Anyone have any suggestions?

    To expand on the problem, I tried doing the same thing just in a panel, like so:
    public class SplashTest {
         public static final File IMAGE_FILE = new File("SplashTest.png");
         public static void main(String[] args) {
              SplashScreen splashScreen = SplashScreen.getSplashScreen();
              Graphics2D g2d = splashScreen.createGraphics();
              g2d.setColor(Color.RED);
              g2d.fillRect(0, 200, 300, 100);     // draw red rectangle across bottom
              g2d.dispose();
              splashScreen.update();
              try {
                   Thread.sleep(3000);     // show splash for 3 seconds before exiting
              } catch (Exception e) {
                   e.printStackTrace();
              splashScreen.close();
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        try {
                             JFrame frame = new JFrame("Try it again");
                             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                             final BufferedImage image = ImageIO.read(IMAGE_FILE);
                             Graphics2D g2d = image.createGraphics();
                             g2d.setColor(Color.RED);
                             g2d.fillRect(0, 200, 300, 100);     // draw red rectangle across bottom
                             g2d.dispose();                         
                             JPanel panel = new JPanel() {
                                  @Override
                                  protected void paintComponent(Graphics g) {
                                       super.paintComponent(g);
                                       g.drawImage(image, 0, 0, this);
                             frame.setContentPane(panel);
                             frame.setSize(300, 300);
                             frame.setLocationRelativeTo(null);
                             frame.setVisible(true);
                        } catch (IOException ioe) {
                             ioe.printStackTrace();
    }The rectangle shows up completely in the JPanel, which suggests the problem is somehow specific to the SplashScreen. For now I'm just going to edit the image so I'm not trying to paint over any transparent regions. But if anyone can shed any light on this, please do. :-)
    Edited by: Skotty on Jul 26, 2010 10:17 PM

Maybe you are looking for

  • Mail: How to check an account ONLY from specific Network Location?

    I use multiple macs, and use my .mac account to synchronize mail accounts, rules, smart mailboxes, signatures, etc. However, I'd actually like to specifically NOT check certain accounts on some machines. Even though the account settings are synced, I

  • HP Connected server issues

    My printer has been working well *. since I purchased it earlier this year. until about a week ago when I upgraded to the next level Instant Ink plan. Since then when I try to print the display on the printer shows a rotating circle with the word Pri

  • FINALLY added Turbojet2 to AUR, now I have a build problem...

    (PKG location: https://aur.archlinux.org/packages.php?ID=54658 ) I, again, have to point out (for fairness and honor) that I got help from someone (I think two people, iirc) in the main IRC channel to get this pkg working initially at least 6 months

  • What PayPal business tiers does FormsCentral support?

    I would like to integrate my forms with a PayPal payment processing system. However, I need to find out what service tiers Adobe supports (e.g. Standard, Advanced or Pro). The reference is located at https://www.paypal.com/webapps/mpp/compare-busines

  • Can I turn off Genius & On-The-Go on iPod

    There are 2 items in my iPod 5G Music Playlists that I would like to get rid of: 1 Genius 2. On-The-Go I have my iPod set to sync only selected playtlists and the 2 mentioned above are not even in my iTunes playlist. I am sure that these are 2 ROM co