PNG 8-bit Indexed With Alpha

Hello,
I need to write PNG images in 8-bit indexed mode (
Color Type 3... ?) with an alpha channel. I believe that the
only way to do this is by putting the Alpha (or Matte) information
into a PNG tRNS Chunk. I have heard that Fireworks can do this, but
have not yet been successful. Please tell me how.
BTW, I can write PNG files in 32-bit ARGB mode, but this is
unacceptible because the compression is lossless and the files
become huge. XnView supports this as well. Photoshop will not allow
me to write PNG with Alpha. Can Fireworks help me? How?
- Thank you, David Manpearl
<dmanpearl_at_imatte_dot_com>

DavidManpearl wrote:
> Hello Linda,
>
> Thank you very much for your suggestion of making one of
the image colors
> represent transparent matte, as in a GIF format image.
> Unfortunately, this cannot work for me as I need color
information for all of
> the pixels in the image, regardless of the setting of
the matte, or alpha
> channel value. Perhaps this is impossible for PNG with
indexed color? The
> answer to this question is what I hope to determine one
way or the other
> through this forum.
Why not just export in 8-bit PNG format, with no
transparency, and see
if it works?
Linda Rathgeber ACE ::: PVII
http://www.projectseven.com
Fireworks Newsgroup:
news://forums.projectseven.com/fireworks/
CSS Newsgroup: news://forums.projectseven.com/css/
Adobe Community Expert - Fireworks
Design Aid Kits:
http://www.webdevbiz.com/pwf/index.cfm

Similar Messages

  • Best visually lossless codec for cartoon prerenders with alpha

    Hey guys.  I've done a lot of research on this but still cannot find a satisfying solution.
    I have hundreds of comps that I would like to prerender and re-use on a regular basis.  These comps are simple solid colors, cartoons, for character animation.  They contain LOTS of blank space, with the image only comprising a small part of the frame.  This is necessary to line everything up in the end.  I need to be able to decode these prerenders on Mac and Windows, but it is OK if they can only be encoded on Mac.  I need it to be a fast codec for decoding, but I do not care how long it takes to encode them.  I don't care what the container is, but Quicktime seems like the best container that AE supports.
    After doing lots of tests, the only reasonable formats I could find were:
    ProRes 4444
    Animation
    I have tried DnxHD, PNG (Quicktime), PNG (Image sequence), and all the other ProRes variants (with a separate movie for alpha).  DnxHD doesn't work because it only works at fixed sizes and maxes out at 1920x1080.  All the other ProRes variants don't work because they don't have alpha, and when I use a separate ProRes render for Alpha, there's artifacts on the edges.  PNG in quicktime is far too slow to decode, and the files are bigger than Animation.  Using image sequences is a pain to maintain and seems to be slower as well.  I wish I could try out codecs like HuffYuv and Lagarith, but they are not supported on Mac.
    ProRes 4x4 would be perfect, but I have no need for 16-bit color.  Animation is the fastest codec, but produces files that are too big.  At 75% quality, it produces files smaller than ProRes, but introduces some artifacts.
    Wondering if there is an 8-bit codec with alpha that anyone would recommend for this. 
    Also, I am wondering if using a single, very long Quicktime file is faster for AE to use than lots of shorter Quicktime files.
    Thanks,
    Bryan

    I think I found that PNG was kindof slow to render.  I will give it another look. 
    The duration of the file question is really just about how AE manages its memory.  Whether having a single file is better or many files.  For game development, I am used to generating single spritesheets which contain all image data, rather than many small files.  I am wondering if something similar is true with AE.  I am basically trying to optimize our workflow as much as possible for maximum AE performance.
    In the case of using one quicktime, it would be duplicated many times in AE, and time-remapped to break it apart into layers.  Or it would simply already be broken apart as separate files.  All files would be used all the time, as they are all the elements of a character's head rig (eyes, eyebrows, mouth, etc).  In case you are wondering, the reason I want to prerender them is because they contain a lot of CPU-intensive effects (Mesh Warp, etc).  These head rigs really slow down our workflow and also cause frequent crashes.

  • Why can't I export a 24 bit PNG with alpha transparency?

    I have just upgraded my Macromedia Studio 8 to Adobe CS3, and
    it seems that I still can't export a 24 bit png with transparency
    from Fireworks (Photoshop can do it, but it's just not suited for
    volume graphic production). Anyone know something I don't, or can
    someone at least explain why I can have alpha transparency on 8 bit
    and 32 bit, but not 24 bit pngs? Currently, I'm planning to export
    everything from Fireworks, then batch-process through Photoshop to
    reduce from 32 bit to 24 bit, which is just... gah! Words fail
    me.

    Kathleen13 wrote:
    > I have just upgraded my Macromedia Studio 8 to Adobe
    CS3, and it seems that I
    > still can't export a 24 bit png with transparency from
    Fireworks (Photoshop can
    > do it, but it's just not suited for volume graphic
    production). Anyone know
    > something I don't, or can someone at least explain why I
    can have alpha
    > transparency on 8 bit and 32 bit, but not 24 bit pngs?
    Currently, I'm planning
    > to export everything from Fireworks, then batch-process
    through Photoshop to
    > reduce from 32 bit to 24 bit, which is just... gah!
    Words fail me.
    >
    If I'm correct, 8-bit png supports index transparency just
    like GIF's
    do. 32-bit png's support alpha channel transparency, so you
    can get
    variable or partial transparency in a full color image(8 bits
    for each
    color and 8 bits for an alpha channel) and 24-bit png's are
    similar
    jpegs, only you get lossless compression and no user-defined
    settings.
    So essentially, when you export a 32-bit png file you are
    exporting a 24
    bit color image with an 8-bit alpha channel.
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    Extending Knowledge, Daily
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    news://forums.macromedia.com/macromedia.fireworks
    news://forums.macromedia.com/macromedia.dreamweaver

  • Graphics, ImageIO, and 32-bit PNG images with alpha-channels

    I have a series of 32-bit PNG images, all with alpha channels. I'm using ImageIO.read(File) : BufferedImage to read the PNG image into memory.
    When I call graphics.drawImage( image, 0, 0, null ); I see the image drawn, however all semi-transparent pixels have a black background, only 100% transparent pixels in the source image are transparent in the drawn image.
    The Graphics2D instance I'm drawing to is obtained from a BufferStrategy instance (I'm painting onto an AWT Canvas).
    Here's my code:
    Loading the image:
    public static BufferedImage getEntityImage(String nom, String state) {
              if( _entityImages.containsKey(nom) ) return _entityImages.get( nom );
              String path = "Entities\\" + nom + "_" + state + ".png";
              try {
                   BufferedImage image = read( path );
                   if( image != null ) _entityImages.put( nom, image );
                   return image;
              } catch(IOException iex) {
                   iex.printStackTrace();
                   return null;
         private static BufferedImage read(String fileName) throws IOException {
              fileName = Program.contentPath + fileName;
              File file = new File( fileName );
              if( !file.exists() ) return null;
              return ImageIO.read( new File( fileName ) );
         }Using the image:
    Graphics2D g = (Graphics2D)_bs.getDrawGraphics();
    g.setRenderingHint( RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON);
    public @Override void render(RenderContext r) {
              Point p = r.v.translateWorldPointToViewportPoint( getLoc() );
              int rad = getRadius();
              int x = (int) p.x - (rad / 2);
              int y = (int) p.y - (rad / 2);
              BufferedImage image = Images.getEntityImage( getCls(), "F" );
              r.g.drawImage( image, x, y, null );
         }

    You may want to check on you system and see what ImageReaders are available, it could be ImageIO is just not picking the best one, if not, then you can use getImageReaders to get an iterator of image readers, then choose the more appropriate one.

  • Opening Fireworks PNG-8s with alpha transparancy

    Hi all,
    I have to do some work on some files I didn't create -- a couple hundred png files. They are 8-bit, indexed files, but when viewed on the web they have 256 levels of alpha transparency. When opened in Photoshop, they have only one level of alpha transparency :(
    Turns out these are in some proprietary Fireworks format ... anyone have any ideas how I can get these into Photoshop without losing my alpha channel, hopefully without having to BUY Fireworks ... oh how I miss ImageReady ;)
    Thanks in advance.

    Photoshop doesn't work with continuous transparency in indexed color mode, only one transparent value is allowed. (ImageReady wouldn't do it, either)
    You may need to use another application to convert them to a normal RGB image with transparency.

  • ImageIO PNG Writing Slow With Alpha Channel

    I'm writing a project that generates images with alpha channels, which I want to save in PNG format. Currently I'm using javax.ImageIO to do this, using statements such as:
    ImageIO.write(image, "png", file);
    I'm using JDK 1.5.0_06, on Windows XP.
    The problem is that writing PNG files is very slow. It can take 9 or 10 seconds to write a 640x512 pixel image, ending up at around 300kb! I have read endless documentation and forum threads today, some of which detail similar problems. This would be an example:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6215304|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6215304]
    This surely must be resolvable, but after much searching I've yet to find a solution. If it makes any difference, I ONLY want to write png image, and ONLY with an alpha channel (not ever without), in case there are optimisations that that makes possible.
    If anyone can tell me how to address this problem, I'd be very grateful.
    Many thanks, Robert Redwood.

    This isn't a solution, but rather a refinement of the issue.
    Some of the sources I was reading were implying that the long save time might be due to a CPU heavy conversion process that had to take place before the BufferedImage could be saved. I decided to investigate:
    I loaded back in one of the (slowly) saved PNG images using ImageIO.read(file). Sure enough, the BufferedImage returned differed from the BufferedImage I had created. The biggest difference was the color model, which was DirectColorModel on the image I was generating, and was ComponentColorModel on the image I was loading back in.
    So I decided to manually convert the image to be the same as how it seemed to end up anyway. I wrote the following code:
          * Takes a BufferedImage object, and if the color model is DirectColorModel,
          * converts it to be a ComponentColorModel suitable for fast PNG writing. If
          * the color model is any other color model than DirectColorModel, a
          * reference to the original image is simply returned.
          * @param source The source image.
          * @return The converted image.
         public static BufferedImage convertColorModelPNG(BufferedImage source)
              if (!(source.getColorModel() instanceof DirectColorModel))
                   return source;
              ICC_Profile newProfile = ICC_Profile.getInstance(ColorSpace.CS_sRGB);
              ICC_ColorSpace newSpace = new ICC_ColorSpace(newProfile);
              ComponentColorModel newModel = new ComponentColorModel(newSpace, true, false, ComponentColorModel.TRANSLUCENT, DataBuffer.TYPE_BYTE);
              PixelInterleavedSampleModel newSampleModel = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, source.getWidth(), source.getHeight(), 4, source.getWidth() * 4, new int[] { 0, 1, 2, 3 });
              DataBufferByte newDataBuffer = new DataBufferByte(source.getWidth() * source.getHeight() * 4);
              ByteInterleavedRaster newRaster = new ByteInterleavedRaster(newSampleModel, newDataBuffer, new Point(0, 0));
              BufferedImage dest = new BufferedImage(newModel, newRaster, false, new Hashtable());
              int[] srcData = ((DataBufferInt)source.getRaster().getDataBuffer()).getData();
              byte[] destData = newDataBuffer.getData();
              int j = 0;
              byte argb = 0;
              for (int i = 0; i < srcData.length; i++)
                   j = i * 4;
                   argb = (byte)(srcData[i] >> 24);
                   destData[j] = argb;
                   destData[j + 1] = 0;
                   destData[j + 2] = 0;
                   destData[j + 3] = 0;
              //Graphics2D g2 = dest.createGraphics();
              //g2.drawImage(source, 0, 0, null);
              //g2.dispose();
              return dest;
         }My apologies if that doesn't display correctly in the post.
    Basically, I create a BufferedImage the hard way, matching all the parameters of the image I get when I load in a PNG with alpha channel.
    The last bit, (for simplicity), just makes sure I copy over the alpha channel of old image to the new image, and assumes the color was black. This doesn't make any real speed difference.
    Now that runs lightning quick, but interestingly, see the bit I've commented out? The alternative to setting the ARGB values was to just draw the old image onto the new image. For a 640x512 image, this command (drawImage) took a whopping 36 SECONDS to complete! This may hint that the problem is to do with conversion.
    Anyhow, I got rather excited. The conversion went quickly. Here's the rub though, the image took 9 seconds to save using ImageIO.write, just the same as if I had never converted it. :(
    SOOOOOOOOOOOO... Why have I told you all this?
    Well, I guess I think it narrows dow the problem, but eliminates some solutions (to save people suggesting them).
    Bottom line, I still need to know why saving PNGs using ImageIO is so slow. Is there any other way to fix this, short of writing my own PNG writer, and indeed would THAT fix the issue?
    For the record, I have a piece of C code that does this in well under a second, so it can't JUST be a case of 'too much number-crunching'.
    I really would appreciate any help you can give on this. It's very frustrating.
    Thanks again. Robert Redwood.

  • Automator or Applescript using png files with alpha channel

    I have hundred of png files with alpha channel.
    I want to suppress alpha channel.
    How can i do it using Automator or Applescript ?
    Thank you very much.

    You can use the free command line image processing tool ImageMagick in your Applescripts or Automator workflows, as well as from a Terminal shell.
    You can download ImageMagick from http://www.imagemagick.org, but Cactuslab has simplified installation by putting together an installer package. It’s available at  http://cactuslab.com/imagemagick/. Download the package and double-click on it. Follow the instructions to install. It will install ImageMagick into /opt/ImageMagick and add it to your $PATH by creating a file in /etc/paths.d/. Restart your computer for the changes to take effect.
    The two ImageMagick commands we’re concerned with are “convert” and “mogrify”. Convert is more efficient for multiple and piped operations on the same image file, and mogrify is more efficient for batch processing. Generally speaking, convert will output a file separate from the input file. Unless a path is specified, mogrify will overwrite the input file with the output file. An important distinction.
    You can perform various operations on the alpha channel using arguments after either the convert or mogrify command. Two of the available arguments are:
    -alpha off - Disables the image's transparency channel. Does not delete or change the existing data, just turns off the use of that data.
    -alpha remove - Composite the image over the background color.
    Also of use are the -flatten and -background options:
    -flatten - overlay all the image layers into a final image and may be used to underlay an opaque color to remove transparency from an image.
    -background - sets the background color.
    Start off using the convert command with a single image to see the effect and adjust to your liking. Once you’ve achieved the desired outcome, then use the mogrify command to batch process the chosen images.
    Before getting into how to use Automator or Applescript in your workflow, use Terminal and the command line to see the effect on a single image. Copy one image to your ~/Desktop. In Terminal change the directory to ~/Desktop by typing the following command and pressing the Enter key:
    cd ~/Desktop
    Then choose the option you are looking for, -alpha remove for instance, type the following command and press the Enter key:
    convert input-photo.png -alpha remove output-photo.png
    You can check the alpha channel (transparency) and background in the Preview app, go View > Show Image Background from the menu bar.
    Once you’re ready to batch proces, place all the photos you want to convert with the same command into one folder. Copy the folder to your ~/Desktop. Let’s assume you’ve labeled the folder “InPhotos”. It’s prudent to manipulate copies in case something goes amiss. In that event you can copy the folder with the originals again and start over. Create a new empty folder on your ~/Desktop and call it “OutPhotos”. Let’s also assume your home directory is called “Me”. The following command will process the photos from the InPhotos folder and put them in the OutPhotos folder:
    mogrify -alpha remove -path /Users/me/Desktop/OutPhotos/ /Users/me/Desktop/InPhotos/*png
    According to Apple Technical Note TN2065:
    "when you use just a command name instead of a complete path, the shell uses a list of directories (known as your PATH) to try and find the complete path to the command. For security and portability reasons, do shell script ignores the configuration files that an interactive shell would read"
    So, you need to use the full path to to ImageMagick commands, unlike in the shell where you can just use the command name.
    To batch process using Automator, use the “Run Shell Script” action (note: retain the single space at the beginning of the last line):
    /opt/ImageMagick/bin/mogrify \
    -alpha remove \
    -path /Users/Me/Desktop/OutPhotos/ \
    /Users/Me/Desktop/InPhotos/*png
    To batch process using Script Editor (Applescript), use the “do shell script” command:
    do shell script "/opt/ImageMagick/bin/mogrify -alpha remove -path /Users/pd/Desktop/OutPhotos/ /Users/pd/Desktop/InPhotos/*png"
    Further info on ImageMagick:
    http://www.imagemagick.org/script/command-line-options.php#alpha
    http://www.imagemagick.org/Usage/masking/#remove
    http://www.imagemagick.org/index.php
    http://www.imagemagick.org/script/command-line-tools.php
    http://www.imagemagick.org/script/command-line-options.php
    Examples:
    The original PNG image:
    -alpha off:
    -alpha remove:
    -background black -flatten:
    -background blue -flatten:
    -channel alpha -evaluate Divide 2:
    -channel alpha -evaluate Divide 2 -background black -flatten:

  • Export PNG images with alpha channel from flash

    Hi,
    I have this FLA with animation and when played, the animation has alpha channel. I can’t understand why when I look in the library I see the frames without the alpha channel and also when I try to export/extract the image again the image don’t have alpha channel.
    How is it that in flash this image has alpha channel and how to get it out like that into PNG?
    Here is the link to download the FLA:
    http://download759.mediafire.com/nb749r29220g/e0636ab0ru6ouoa/Untitled-1.fla

    "when played, the animation has alpha channel"
    how are you playing the animation? control/enter in Flash, Publishing to a Web page or what?
    How can you tell that the animation has the alpha channel? What exactly are you seeing?
    What is the aniimation? a series of images, one image moving? Are teweens imvolved?
    " when I try to export/extract the image again the image don’t have alpha channel"
    How are you exporting the image? is it a single image? or a series of frames that makes up an animation?
    What was the file format of the original image? you brought that image into Flash and animated it? Now you want to export as a .png with transparency?
    Have you ever tried to export a  simple .png before so that you see and understand the dialog box that pops up during export? are you chosing "24 bit with alpha channel" in the "Colors" choice?
    For those of us who may not want to download your file, please provide a more detailed describtion of everything related to this question.
    Best wishes,
    Adninjastrator

  • Export movie with alpha to png sequence

    I'm trying to export tweened animation to .png image sequence
    with alpha transparency.
    The individual png files appear to be clean -- but when I
    open the file sequence in QuickTime, it looses the 8-bit alpha.
    Anyone know how to get around this? Thanks!
    QT 7.4.1, 10.5.2, CS3

    MCs are dynamic and designed to play at runtime in the flash
    player - to export to video you simply
    need to convert them to Graphic symbols.
    --> Adobe Certified Expert *ACE*
    --> www.mudbubble.com
    --> www.keyframer.com
    xfiretyra wrote:
    > I've created a flash animation and I need to export it
    to Quick time or PNG
    > sequence so I then can importet to premiere. When I
    export it to Quicktime the
    > movie clips in the scenes doesn't play and the same with
    PNG. So now Im cuting
    > out all the movie clips to individual scenes. However
    this is a hell of a job
    > as when I paste the frames on to the scenes they don't
    end up on the right
    > place, centered on the page so I've to almost redo
    everything. Do you have any
    > good advice for me how to make it a bit easier?
    >

  • Export selected item as PNG with Alpha

    Hello.
    I'm building game graphics in Illustrator.  I have thousands of individual sprites to export, up until now I've been copying and pasting in Photoshop and exporting through there, but that is tedious and slow.  Inkscape has an option to export the selected object only as a PNG with alpha, pixel dimensions are equal to the current selection size.  Perfect.  But that means using Inkscape and quite frankly it's horrible to use.
    I'm sure this must be possible, but for the life of me I can't find a working method.  I found Windows scripts for CS3, but nothing for CS5 on Mac.
    Can anyone help?

    Should not be too hard to adapt the script for Mac, assuming it is JavaScript, not VBScript. If you can point to the source, someone might be able to fix it for you (also post in the scripting sub-forum). Other than that you can of course always make use of the slice tool and fit the slices to the objects, then export the slices.
    Mylenium

  • OUTPUTING AS PNG WITH ALPHA??

    Hello to everyone...
    I hope someone can give helping hand...
    I'm working on a project where I need to output single frame files as PNG's with Alpha channel.  So far, I've used the "save frame as" function and then selected "file".  In the Render Queue under output module, I selected PNG sequence.  In the output settings under video output, I selected RGB + Alpha and Millions of colors +   I also selected "interlaced" under format options as the files are for web.  But when I open the single frame in Photoshop, the ALPHA channel is not there.
    Can someone tell me what I'm doing wrong?  I know that PNG's can be saved with an Alpha I just can't seem to make it work.
    Please help!
    Thanks
    Bgub.

    Define work area if rendering in portions, then go  "add to render queue" instead of "save frame" and modify output module to PNG Sequence RGB+Alpha, Millions of Colors+
    PNG+Alpha still work here for me in CS3. Maybe Adobe removed support for outputting PNG Still Image Seuquence with Tranparency. I would not wonder because they often toss functionalities, only god knows why they're doing it.
    Otherwise use TIFF Sequence

  • How to read and write Png and jpeg with  Alpha

    Hi
    I have trouble reading and writeing PNG and JPEGs that have an alpha channel (for transparency).
    Reading works, if i use Toolkit.getImage() method, but works NOT if i use ImageIO.read() method.
    Writing does NOT work using ImageIO.write()method. Instead i got a "java.lang.UnsupportedOperationException: Unsupported write variant!"
    See Test class and commandline output below:
    /****************START*****************************/
    package de.multivisual.bodo.test;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.File;
    import java.net.URL;
    import java.util.Iterator;
    import javax.imageio.*;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.stream.ImageInputStream;
    import javax.imageio.stream.ImageOutputStream;
    public class AlphaChannelTest implements ImageObserver {
      Toolkit toolkit;
      Image img;
      public AlphaChannelTest() {
        super();
        toolkit = Toolkit.getDefaultToolkit();
        URL url =
          AlphaChannelTest.class.getResource(
            "/de/multivisual/bodo/test/" + "alphatest.png");
        img = toolkit.getImage(url);
        try {
          ImageInputStream imageInput =
            ImageIO.createImageInputStream(url.openStream());
          Iterator it = ImageIO.getImageReaders(imageInput);
          ImageReader reader = null;
          while (it.hasNext()) {
            reader = (ImageReader) it.next();
            System.out.println(reader.toString());
          reader.setInput(imageInput);
          ImageReadParam param = reader.getDefaultReadParam();
          BufferedImage bimg = reader.read(0, param);
          SampleModel samMod = bimg.getSampleModel();
          ColorModel colMod =       bimg.getColorModel();
          String[] propNames = bimg.getPropertyNames();
          IIOMetadata meta = reader.getImageMetadata(0);
          System.err.println("\n*****test image that was read using new Jdk 1.4 ImageIO.read() method");
          alphaTest(bimg);
        } catch (Exception e) {
          //e.printStackTrace();
        if (img != null)
          toolkit.prepareImage(img, -1, -1, this);
        try {
          synchronized (this) {
            System.out.println("wait");
            this.wait();
        } catch (Exception e) {
          e.printStackTrace();
        System.out.println("end");
      public void alphaTest(BufferedImage bi) {
        Raster raster = bi.getData();
        float[] sample = null;
        System.out.println("raster :");
        for (int y = 0; y < raster.getHeight(); y++) {
          for (int x = 0; x < raster.getWidth(); x++) {
            sample = raster.getPixel(x, y, sample);
            System.out.print("(");
            for (int i = 0; i < sample.length; i++) {
              System.out.print(":" + sample);
    System.out.print(")");
    System.out.println();
    Raster araster = bi.getAlphaRaster();
    if (araster == null){
         System.err.println("there is no Alpha channel!!!!!!!!!");
         return ;
    } else {
         System.out.println("Alpha channel found !");
    float[] asample = null;
    System.out.println("raster alpha:");
    for (int y = 0; y < araster.getHeight(); y++) {
    for (int x = 0; x < araster.getWidth(); x++) {
    asample = araster.getPixel(x, y, asample);
    for (int i = 0; i < asample.length; i++) {
    System.out.print(" " + asample[i]);
    System.out.println();
    String format ="PNG";
    System.out.println("##########Test Writing using new JDK1.4.1 ImageIO:");
    Iterator writers = ImageIO.getImageWritersByFormatName(format);
    ImageWriter writer = (ImageWriter) writers.next();
    ImageWriteParam param = writer.getDefaultWriteParam();
    ImageTypeSpecifier imTy = param.getDestinationType();
    ImageTypeSpecifier imTySp =
    ImageTypeSpecifier.createFromRenderedImage(bi);
    param.setDestinationType(imTySp);
    File f = new File("c:/tmp/myimage."+format);
    try {
    ImageOutputStream ios = ImageIO.createImageOutputStream(f);
    writer.setOutput(ios);
    writer.writeInsert(0, new IIOImage(bi, null, null), param);
    } catch (Exception e) {
         System.err.println("could not write "+format+" file with alpha channel !");
    e.printStackTrace();
    public boolean imageUpdate(
    Image img,
    int infoflags,
    int x,
    int y,
    int width,
    int height) {
    if ((toolkit.checkImage(img, -1, -1, null)
    & (ImageObserver.HEIGHT | ImageObserver.WIDTH | ImageObserver.ALLBITS))
    == 35) {
    int iw = img.getWidth(this);
    int ih = img.getHeight(this);
    BufferedImage bi = new BufferedImage(iw, ih, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D big = bi.createGraphics();
    big.drawImage(img, 0, 0, this);
    System.err.println("+++++test image that was read using old Toolkti.getImage method");
    alphaTest(bi);
    synchronized (this) {
    this.notifyAll();
    return false;
    return true; // image is not yet completely loaded into memory
    public static void main(String[] args) {
    //     BufferedImage image = new
    // BufferedImage();
    new AlphaChannelTest();
    /*************************END********************/
    The commandline looks like this:
    [i]
    com.sun.imageio.plugins.png.PNGImageReader@d1fa5
    *****test image that was read using new Jdk 1.4 ImageIO.read() method
    raster :
    there is no Alpha channel!!!!!!!!!
    wait
    +++++test image that was read using old Toolkti.getImage method
    raster :
    Alpha channel found !
    raster alpha:
    ##########Test Writing using new JDK1.4.1 ImageIO:
    could not write PNG file with alpha channel !
    java.lang.UnsupportedOperationException: Unsupported write variant!
         at javax.imageio.ImageWriter.unsupported(ImageWriter.java:600)
         at javax.imageio.ImageWriter.writeInsert(ImageWriter.java:973)
         at de.multivisual.bodo.test.AlphaChannelTest.alphaTest(AlphaChannelTest.java:113)
         at de.multivisual.bodo.test.AlphaChannelTest.imageUpdate(AlphaChannelTest.java:135)
         at sun.awt.image.ImageWatched.newInfo(ImageWatched.java:55)
         at sun.awt.image.ImageRepresentation.imageComplete(ImageRepresentation.java:636)
         at sun.awt.image.ImageDecoder.imageComplete(ImageDecoder.java:135)
         at sun.awt.image.PNGImageDecoder.produceImage(PNGImageDecoder.java:511)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:257)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:168)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    end

    in between i found out that the my png and jpeg test images did not have an alpha channel, since the tool i used to create them, did not write the alpha channel to disk.
    if i use png with alpha channel, then the read works correktly with ImageIO.read()
    however the read problem still remains for gifs and the write does not work for gifs and neither for pngs.
    whether jpegs can be read with alphachannel i don't know since i don't have a tool to create jpeg with alpha channel. (at least gimp and corel9 are not able to )
    and it is not possible to write the previous read png with alpha channel back as and jpeg with alpha channel

  • Index and Alpha transparencies

    This is a multi-part message in MIME format.
    ------=_NextPart_000_0008_01C73F09.CBD4E090
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    I am saving images in Gif with a transparent background and
    it gives me =
    a choice of index or alpha transparancy choices.
    I searched on Google to try to find the difference, but
    cannot. Can =
    anyone explain the difference between the two?
    Thank you,
    Scott
    ------=_NextPart_000_0008_01C73F09.CBD4E090
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    charset=3Diso-8859-1">
    <META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
    <STYLE></STYLE>
    </HEAD>
    <BODY bgColor=3D#ffffff>
    <DIV><FONT face=3DArial size=3D2>I am saving
    images in Gif with a =
    transparent=20
    background and it gives me a choice of index or alpha
    transparancy=20
    choices.</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>I searched on
    Google to try to find the =
    difference,=20
    but cannot. Can anyone explain the difference between the =
    two?</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Thank
    you,</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial
    size=3D2>Scott</FONT></DIV></BODY></HTML>
    ------=_NextPart_000_0008_01C73F09.CBD4E090--

    Scott Powell wrote:
    > I am saving images in Gif with a transparent background
    and it gives me a choice of index or alpha transparancy choices.
    >
    > I searched on Google to try to find the difference, but
    cannot. Can anyone explain the difference between the two?
    Index transparency is used for GIF images. GIFs allow
    single-bit
    transparency, which means when you are creating your image,
    you can
    specify one color to be transparent.
    Alpha transparency is used for PNG files. Instead of the
    vestigial
    transparency option of the GIF format, where a pixel is
    either
    transparent or opaque, an alpha channel can specify the
    opacity of any
    pixel from 0–255, where 0 is fully transparent and 255
    is fully opaque.
    This allows you to create a graphic that can be placed on top
    of any
    background color and will retain a translucent effect, with
    the
    background showing through the pixels that are not opaque.
    The drawback
    is that I.E. versions 5 & 6 do not display variable Alpha
    transparency
    without a workaround. I.E.7 gets it right, however.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/

  • Quartz bug with movies with alpha - workarounds?

    Hello, I've found an odd glitch in Quartz Composer, and would like some help working around it;
    I created a movie with alpha (32-bit PNG to .mov, PNG, millions+ via QuickTime 7. Tested and it exported correctly) and loaded this using a Movie Importer patch (with Colour Correction disabled). Sending this directly to a billboard, the alpha is there, but way off in value (seems to be shifted to range ~0.5-1.0 instead of 0.0-1.0, but 0 is still 0)
    While trying to fix this, I found that putting a pixel-editing patch between the importer and the billboard makes the problem (almost) go away (doesn't work with a resizing patch, but Color Controls and Color Matrix, with all values at default, work), which says to me that this is a bug rather than my misunderstanding. But it still doesn't render correctly - seems to be from ~0.1-1.0, possibly with gamma too.
    Is there something I missed (maybe a disable colour correction option somewhere?) or a workaround somebody knows?

    HI Gary,
    You may have to reset keyboard shortcuts for different applications. Not an unusual thing to happen after an upgrade.
    Go here for help. http://docs.info.apple.com/article.html?path=QuickTime+Player/7.0/en/kbshortcuts .html
    BTW... could you please click My Settings on the right side of this page and tell us which Mac you have and add 10.6 to your profile. It will help us to help you in the future. Thanks!
    Carolyn
    Message was edited by: Carolyn Samit

  • Why can't I see the Finder thumbnails for .mov files with alpha channels?

    Ever since I upgraded to Mavericks I haven't been able to see the thumbnail for or preview using spacebar any .MOV clips that contain alpha channels in Finder. PSDs and PNGs with alpha channels are fine, and I can still see their thumbnails and previews, it's just .MOV clips with alpha. Here are a couple screenshots:
    Most of these clips are using a PNG codec, but I converted on to the Animation codec and tested it in After Effects to make sure it kept the alpha channel and it did, but the same thumbnail error persists.
    Any idea why this might be or how to fix it?
    27" iMac late 2012
    1TB Fusion
    NVIDIA GeForce GTX 680MX 2048 MB
    16GB RAM
    OS X Mavericks
    Thanks.

    ok, have copied the photos again from the memory card and hey presto, it all works fine.  So in summary...for RW2 files from GF1 camera, I have no thumbnail images, couldn't view in Preview, and neither Quickview nor Coverview were working.  Ran the bit of code provided at "https://discussions.apple.com/message/18369759#18369759" (thanks to Snoop Dogg) and then recopied the photos onto my Mac (only required for photos copied since upgrading to Lion, everything from before the upgrade is fine anyway).
    Hope others find this helpful.

Maybe you are looking for

  • Why do my events change in the day view, when I create a new event? (iCal for iPad 2)

    Every time I create a new event in the day view in iCal on iPad, the other events (which I created before for the same day) change their starting and/or their ending time. Please help!

  • How to restore iPhoto

    I have recently had to wipe clean my system, and reinstall everything. Before doing so, I transferred what I thought were ALL of my files, only to realize I had "forgotten" my iPhoto library. After re-establishing everything, I realized all of my pho

  • Different Approvers for files in the same folder

    Dear All, We have developed a Webdynpro Application for uploading documents to specific Folders in KM and set the permission to the newly uploaded documents based on the selection given by the user at the time of upload. We are doing enhancements to

  • Chinese & English Text imported from Word

    Hi, I have been having many issues of late importing Chinese/Korean/Japanese/Arabic text in to InDesign. I have created Paragraph Styles, and they match the Word Document, but when I import the word document it ignores the font/style and directly imp

  • Date type is unique by default?

    Hello, I have created a table with date data type. All records are inserted but same date records throws following error: ORA00001-unique constraint (aa.sys_C005487) violated Best regards