Announcement

Collapse
No announcement yet.

PNG Alpha Channel handling

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

    PNG Alpha Channel handling

    Hello out there!

    I've been using IrfanView for a really long time now, and for years it didn't have any transparency handling whatsoever. After recentliy upgrading to the newest version (which I do infrequently because it is so incredibly stable and feature complete that I hardly ever see the need to upgrade at all), I noticed that there have been changes to that a long time ago. So I tried one of my transparent PNGs with a simple use case of "save as PNG", but somehow I'm lost at finding a correct combination of options to check to preserve the alpha channel.

    So, what I want to do:
    1) Open the file I attached
    2) Save the file as PNG (which it already is, I know, it is just a test case)

    What I expect:
    The image looks exactly like the one I loaded, with identical Alpha Channel

    What I got:
    I either managed to have an image which was "half transparent" (I chose 128x3 as window background, it seems to have taken that value as the transparent value for the whole alpha channel), or I got an image with no transparency, but combined with the window background color. I used Photoshop to check the image.

    I'm rather certain that I'm doing something wrong and that I just couldn't figure out what options to choose, so I'd be very happy to get some help with that, thank you!
    Attached Files

    #2
    You cannot resave the original alpha channel with the PNG image when you save it. What you save if you select "Save transparency as alpha channel" is a new mask based on the luminance of the image as it now is.
    That may seem to be of fairly limited value but it is all Irfanview can do, since only the RGB channels are edited when you make any changes. It does not support editing of the alpha channel

    You might find what I posted in the Technical section here useful to show how you might use a saved alpha channel.

    You can save the original alpha layer as an RGB image by selecting "Image > Show channel > Alpha" if that is of any use to you.

    Comment


      #3
      Hrm... that is most unfortunate. I really thought that handling all four channels would have been implemented by now. It isn't as if I couldn't do the same thing with Photoshop, it is just that Irfanview is so much faster and so much more comfortable when doing it for small files or when batchprocessing something. Thanks anyways for making that clear!

      Comment


        #4
        The basic concept of Irfanview is to convert all image types into a standard Device Independent Bitmap when you open them. Then, when you save, you convert back into whatever image type you choose, as long as that type is supported for saving. All editing is done on the DIB and is the same whatever file type you opened from or saved to. That is why it can be small and fast.
        With that in mind it is quite hard to know what should be done with the alpha layer when the RGB layers are being edited. I have thought about it on a number of occasions but cannot come up with a solution that will satisfy everyone without turning Irfanview into yet another Photoshop wannabee.

        Comment


          #5
          How so? A lot of formats has an Alpha Channel by now, other Formats don't. So defaulting it to all white (opaque), and modifying it only if required (e.g. resize, crop, copy/paste and so on) wouldn't turn it into anything IMHO. Besides, it is called "irvanVIEW", not "IrfanSHOP" - it is supposed to be able to view a myriad of image formats (even playing Audio is too much imho), and have some tools to tamper with them for the sake of creating thumbnails or simple conversions. But as I said (or intended to say anyways), it would have been nice, but I'll have to live with it .

          Comment

          Working...
          X