Announcement

Collapse
No announcement yet.

Wrong transparent color when saving in PNG format

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

    Reported Wrong transparent color when saving in PNG format

    Hello!

    I found a bug in PNG saving module (same for PNGOUT PlugIn). When manually selecting transparent color, it's determined incorrectly.

    For example:

    Click image for larger version

Name:	1.png
Views:	1
Size:	41.7 KB
ID:	84721

    Actual color in corners is 128 128 128 RGB (or it can be any other), but IrfanView detects it as 149 148 171 RGB:

    Click image for larger version

Name:	2.png
Views:	1
Size:	13.4 KB
ID:	84722

    If manually change color in TweakPNG to correct values:

    Click image for larger version

Name:	3.png
Views:	1
Size:	13.4 KB
ID:	84723

    Then all becomes ok:

    Click image for larger version

Name:	4.png
Views:	1
Size:	41.6 KB
ID:	84724

    I noticed this only, when choosing transparent color in window corners, in other cases seems, that all normal.

    I use IrfanView 4.38, full installation with all plugins, OS Windows XP SP3.

    Hope, that you will fix this issue.
    Last edited by ViewFan; 23.12.2014, 03:44 AM.

    #2
    Any comments?

    Comment


      #3
      I couldn't reproduce it. The area to click is far too small to know which pixel was selected. I suspect there's some anti-aliasing in those corners. The bug seems too trivial to be worth following up. Anyone can send bug reports to Irfan directly if they wish.
      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

      Comment


        #4
        IMHO you should not bother Irfan with this. You are trying to do some fairly advanced things and I think you need to learn a bit more about Irfanview before assuming that it is a bug.

        Lesson 1. If you want to work with tiny areas then learn how to zoom in. All my examples show your first image with the zoom wound up to 800%. The one immediately below illustrates the first lesson. If you want to look at colors at this zoom level you must not resample. Resampling invents new colored pixels to smooth the transitions between the original colors. Great for photographs and small web pictures when you want them to look like a slightly out of focus version of a much higher resolution photo but useless to see what the original colors were. So uncheck that "Use resample for zooming" before you start winding up the magnification.

        Click image for larger version

Name:	Do not resample.png
Views:	1
Size:	59.8 KB
ID:	81217

        Lesson 2. Understand the transparency options. At the top of the Viewing tab of Properties/Settings is the option to either turn on or off the transparency of those image types that support both single color and Alpha layer transparency. That includes PNG files. If that box is unchecked as in the left hand image below you will not see any transparency. Instead you will see the original color - the one that you clicked on to select as transparent when you saved it. Now you can see that the color of those corners is a solid (128, 128, 128) over the whole of the tiny triangles.
        If the box is checked as in the right hand image below transparency is turned on. What you will see in the transparent areas is the Main window color underneath the image. The color is set at the bottom of the Viewing tab and you see I chose a bright purple. You have just 3 transparent pixels. I would say that you missed the corner when you clicked to select the transparent color.
        Note that you have to save a new transparency option by closing the dialog after changing it and then reload the image before it takes effect.

        Click image for larger version

Name:	Not transparent.png
Views:	1
Size:	61.9 KB
ID:	81218 Click image for larger version

Name:	Is transparent.png
Views:	1
Size:	59.4 KB
ID:	81219

        Lesson 3. Use a workaround. However much you wind up the zoom in Irfanview, the size of the image you click on to set the transparent color is fixed, and too small to select areas as small as those corners accurately. You can try using a magnifier tool to see what you are doing a bit better but you can only magnify what is on the screen and sometimes you still get it wrong. You have an alternative though. You know that you want to make (128,128,128) transparent, so set the main window to that color and in the PNG Save options choose "Use main window color for transparency" instead of "Save transparent color". Make sure that you change the main window color back to a good contrasting color before you check the result though or you will think it has not worked.
        Last edited by Mij; 20.12.2014, 10:28 PM.

        Comment


          #5
          Originally posted by Mij View Post
          I would say that you missed the corner when you clicked to select the transparent color.
          Hell, you right! I really missed the corner (and I did it many times before), because, as it turned out, mouse cursor not accurately points to the pixels (I have Windows XP SP3 with standard 3D-White mouse theme):

          Click image for larger version

Name:	1.png
Views:	1
Size:	22.9 KB
ID:	81221

          And I have to set cursor to one pixel left or upper, than it actually points, to choose correct transparent color.

          Originally posted by Mij View Post
          size of the image you click on to set the transparent color is fixed, and too small
          Yes, and this is a big lack of the program which must be filled. We need a feature of viewing image in this window in full resolution with ability to move it (resizing actually is not so necessary, since it will not help with big images).

          And I tried also your workarounds with magnifier tool and "main window color". They working great.

          Thanks for all your tips and comprehensive answer. Good luck!
          Last edited by ViewFan; 22.12.2014, 04:34 AM.

          Comment

          Working...
          X