Announcement

Collapse
No announcement yet.

Need Alpha Channel Support in PNG images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Forwarded Need Alpha Channel Support in PNG images

    Currently IrfanView does two things with PNG files that have finally reaching the quite annoying stage.

    It doesn't display them correctly using the alpha-channel if present.

    It doesn't preserve the alpha channel if I load a PNG file with alpha and then save it back out.

    I love IrfanView but it seems like more and more I am having to start up GIMP just to do a simple resize or crop of a PNG file.

    FWIW, I am a registered/paid user.

    #2
    Fwiw, this community is trying to address any question of anybody with serious attention, paying or not.
    Do you have examples of 'before' and 'after' files ?

    Never used this alpha channel, so it's a bit guessing :
    In the save as PNG dialog there's an option for the PNGOUT plugin.
    If you check Options you will see choices under 'Color type' with or without Alpha.
    Last edited by Sam_Zen; 15.09.2007, 02:09 AM.
    0.6180339887
    Rest In Peace, Sam!

    Comment


      #3
      Alpha channel is used for transparency with 256 levels of opacity, instead of just 2 levels as in GIF files. Upon loading IrfanView renders the alpha channel to the selected background color (preferences -> viewing -> main window color), the alpha channel itself is then discarded.

      For the sake of argument I tried forcing RGB+Alpha in PNGOut. The same behaviour. But even if it would be possible to do that in pngout, this is no solution for everyday work, because pngout is too slow. There are some uses for it, such as publishing on the internet, where every kB counts.

      There was already a discussion about transparency. If I recall correctly it ended with a rhetorical question: Should IrfanView support layers?

      Comment


        #4
        Hi Everybody,

        IrfanView is able to read the alpha channel (is it correct to call this a layer?), so in my opinion it would be great if it could write them back too, because it's a normal expectation for most users, like Phergus. They probably can't even imagine that alpha channel could be ignored at writing. Otherwise, IrfanView should at least give a message like "Warning! Your image has an alpha channel (transparency). IrfanView will not preserve it. Are you sure you want to save / overwrite your image? Yes / No". But this wouldn't be practical in batch mode; and what about command-line?

        My preference is of course that IrfanView is able to preserve the alpha channel when re-writing the file (this does not mean it should be able to create one). This implies of course more complex operations on the images when they are cropped, resized, etc. because they should also be done on the alpha channel too. But I have no idea wether this is an easy modification or requires in-depth modifications.

        Is this a reasonable Feature request?

        Laurent
        Before you post ... fill in your OS and IV version in your profile.

        Comment


          #5
          Originally posted by Laurent View Post
          My preference is of course that IrfanView is able to preserve the alpha channel when re-writing the file
          Which is exactly what I'm asking for.

          Originally posted by Laurent View Post
          (this does not mean it should be able to create one).
          IrfanView doesn't need support for layers or the creation of alpha-channels. It just shouldn't lose them when it writes the image out again.

          Originally posted by Laurent View Post
          This implies of course more complex operations on the images when they are cropped, resized, etc. because they should also be done on the alpha channel too. But I have no idea wether this is an easy modification or requires in-depth modifications.
          I doubt this would be particularly difficult challenge for Irfan.

          Originally posted by Laurent View Post
          Is this a reasonable Feature request?
          Would people think it was okay if IrfanView saved GIF files and lost the transparency?

          PNG is an important image standard for the web and it needs to be well-supported in IrfanView.
          Last edited by Bhikkhu Pesala; 17.06.2016, 07:54 AM.

          Comment


            #6
            Thanks for the techs about the alpha channel, 7jn.
            I also had the question, as Laurent, is it correct to call this a layer?
            Now that I know the concept better, I would say no. It's more a kind of overlay on the color-palette.
            Maybe the difference is : you can mirror a layer independent of the actual background.

            Of course if some variables and data can be read by IV, it shouldn't be lost when saving again.
            But modifications, let alone converting to other formats, per definition can't guarantee that.
            I strongly agree with Phergus. PNG is my favorite standard for the web, because of the quality and versatility.
            So it should be tuned very well in IrfanView.
            0.6180339887
            Rest In Peace, Sam!

            Comment


              #7
              Alpha channel is basically like another color besides RGB, which can be utilized for any purpose. Currently there is a problem that one may not notice the lost Alpha until it is too late. If IrfanView is your only graphics program and you reload the saved file just to check if it's OK, you'll see the same picture with and without the alphachannel. Happy about the exceptionally good "compression" irfanview has performed, you keep the new file and it's a disaster.

              Comment


                #8
                Originally posted by Sam_Zen View Post
                is it correct to call this a layer?
                Not really, it is more like a fourth color channel, the format is called RGBA.
                I agree with the request, we don't ask for sophisticated management of this channel, just to preserve it, even through resizing and cropping. And its management is, AFAIK, strictly identical to the other channels, so it shouldn't be so hard. The only issue I can see is that it might use twice the memory: once for display (merging channel with background color) and once for manipulations.

                Comment


                  #9
                  Please respect that PNG uses pre-multiplied Alpha. This makes it a little bit more complex.

                  Comment


                    #10
                    Originally posted by PhiLho
                    ..it might use twice the memory: once for display (merging channel with background color) and once for manipulations.
                    So I suppose at least a resemblance, in the practical consequences, with the use of layers.
                    0.6180339887
                    Rest In Peace, Sam!

                    Comment


                      #11
                      This transparency issue has always been bothering me, but this is the first
                      time i see it stated that conclusive.
                      .png is my main storage format and i was encouraged to use irview for the
                      extra pngout-plugin.

                      I think most users aren't even aware of the loss that's happening to them.
                      An example: if you use the 'select color' option to define transparency
                      you might even get a result being only marginally different from the original,
                      on a closer look however you can make out jagged borders and the lost
                      smoothness.

                      I consider this flaw in transparency handling quite severe, rather a bug than
                      a feature request.

                      irview is great, i'd rather not have to give up on it.

                      Comment


                        #12
                        I concur, but hopefully Irfan will implement support in a general way. Last time I ran into this limitation I tried to convert a png image into a Windows icon.

                        Being a programmer myself I have to remark that how a user sees a program and how something is actually implemented are two (sometimes very) different things. In this case "preserving" the alpha can create complications, but not in the way a user might expect. As Midora remarked there are different ways to store the alpha information. pre-multiplied alpha is a great way to quickly show images, but are not so great for editing, especially when combining multiple images (or layers). Some editing commands are easy to extend with alpha support (e.g. cropping) others commands become complex (e.g. color reduction). This means that IrfanView has to work internally with a "neutral" alpha channel format suitable for editing. Then when reading a file convert to this internal format and on writing convert to the alpha format (if any) supported by the output format. All the plug-ins have to be examined by either Irfan and/or the original authors to make this work. Definitely not something I would do on a single Saturday afternoon.

                        Comment


                          #13
                          Originally posted by TheOS
                          how a user sees a program and how something is actually implemented
                          Right on. A user states 'this must be easy-does-it' while the programmer knows better, even with apparent simple things.
                          Your explanation makes this quite clear.
                          Originally posted by Flit
                          on a closer look however you can make out jagged borders and the lost smoothness
                          Why 'rather a bug'? It just does what the command says : select pixels with exactly the same color.
                          So, with e.g. a photo, this will not work correctly because of slightly different colors at edges of transition.
                          It could be possible with a more 'graphical' image, but even then. Color reduction if acceptable should be first.
                          0.6180339887
                          Rest In Peace, Sam!

                          Comment


                            #14
                            Added to Project List
                            Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                            Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                            Comment


                              #15
                              great...thank you

                              Comment

                              Working...
                              X