Announcement

Collapse
No announcement yet.

Saving PNG with alpha transparency

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

    no bug Saving PNG with alpha transparency

    It looks like saving PNG pictures with alpha transparency doesn't work as expected. The selected color becomes transparent, but some other colors become partially transparent.

    1) Open the test picture
    2) Save the picture as PNG, select "save transparent color" and "save transparency as alpha channel"
    3) Select a color to become transparent
    4) Open the saved picture and observe the result

    Expected result:
    Only the selected color becomes transparent.

    What actually happens:
    The selected color becomes transparent and some other colors become partially transparent.

    Please check out the attached pictures.
    My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

    #2
    The original test picture has transparency already. Change the main window colour and reopen the image (Shift+R).
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      You're right, the original picture here is 32 bit and has empty alpha channel. There is something funny going on. My original picture was 24 bit and it didn't have DPI setting.
      I'm trying to upload the original picture in 256 colors. It will work for testing as well.

      To reproduce the issue, take this picture and follow the steps from the first post.
      Then display the resulting picture on different backgrounds and compare the colors to the original. Or you may open the resulting picture in some advanced graphics editor (Gimp or so) and examine the alpha channel.
      Last edited by JendaLinda; 23.02.2021, 03:35 PM.
      My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

      Comment


        #4
        I've tested 32 bit version too, in a virtual machine, and the behavior is exactly the same.

        If you select black or white color as a transparent color, most of the other colors is affected by the issue.
        My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

        Comment


          #5
          I think the intention behind creating an alpha channel is to produce as smooth fading transparency over a range of colors in a photographic image. You wouldn't need to spend 8 bits on a whole channel to mark just one exact color. Maybe the tolerance or curve of this new transparency could be steeper so that brighter colors are affected less. It looks kind of OK if you take a photo against a black background and mark black as transparent. I don't find any application for this function personally because it can't be tweaked.

          Comment


            #6
            I don't think this is intended. The resulting picture looks really bad on some backgrounds, also not all colors are affected in the same way. Most of them are not affected at all.

            I did one more test. I disabled displaying transparency in IrfanView, so it displays only RGB values. I selected white as a transparent color. The RGB values was clearly changed. Especially grays become black. In my opinion, setting transparency is not supposed to change RGB values.

            I didn't find any information about creating smooth transparency in help. To me, it looks like as an oversight.
            My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

            Comment


              #7
              Let's mark this "no bug".

              I was talking with Irfan. This feature is not intended for creating alpha transparency from scratch.
              My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

              Comment


                #8
                No problem.

                Irfan will try to add some information about the feature in the program help.
                My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

                Comment

                Working...
                X