Announcement

Collapse
No announcement yet.

Decrease Color Depth enhancement

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

    Requested Decrease Color Depth enhancement

    Yet, when one chooses to reduce color depth, e.g. of a scanned image, the program tends to make almost white fields less white.
    It would be better, when the new intensity ladder (e.g. 16 colors - 4 BPP) always includes pure black and pure white when luminances in the displayed image exist that are (already) nearly white resp. black.

    I think most users that intend to decrease color depth not only have the intention to save space, but also to remove noise or nearly white background on scanned documents, resp. get true black with text on documents.
    Both have a great impact on printing quality.

    #2
    I don't think the program should second guess what users want. Even though in most cases what you say may be the case.

    If that is what you want then you can increase the contrast.

    Reducing colours should attempt to retain as much colour information as possible. If I scan an old newspaper, perhaps I wish to retain the grey discolouring of the paper, and don't wish it to look pristine white.

    I attach a sample to show you why I think this is a bad idea. I increased the contrast on the original full-colour jpg to compensate for the darkening that happens when you reduce the colours to only 16. A JPG image could be made even smaller, by increasing compression, but that is not the point that I am trying to make.

    If the background had been reduced to white, the image would not look anything like the original stained newspaper colour.
    Attached Files
    Last edited by Bhikkhu Pesala; 01.03.2008, 06:31 PM.
    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. Increasing the contrast works well. In earlier versions of irfanview, any change of contrast, gamma etc. returned the image in a 24BPP mode. So, in future I can increase contrast after BPP reduction instead of before (or do a final contrast step - but this is not possible in batch mode).

      Nevertheless, I'd not agree with your example of the old newspaper. Simply because the noise of an old document background may cause patterns of white areas and almost white areas - which is more unnaturally. Refer to the image zupfkuchen.jpg as an example of this. I'd suggest that most users - sorry, me - want that plain white remains plain white when reducing the color depth.
      Truly, irfanview produces RGB 251x3, resp. RGB 4x3 as the extreme values when reducing to 4BPP, hence resulting in spurious black dots in "white" areas and raster patterned "black" areas in printouts (making text appearing a bit unsharp).
      See the image, where the extracted histogram shows that plain white and true black are not present. The top diagram represents a 24bpp grey sweep, where the bottom diagram represents a 4BPP state.

      BTW: your newspaper effect could well be arranged by reducing the contrast after a 4BPP operation. In effect no information is lost, when Irfanview would set the white RGB to 255x3 instead of 251x3 upon BPP reduction. The only affect on information lies in the actual thresholds where selection for pallette index 0 or 1 (etc.) is performed. These thresholds may well be left unchanged when the 4BPP output produces slightly different results.
      Attached Files

      Comment


        #4
        Yep, I experienced this nuisance quite often, after scanning a paper, and converting it to a 4BPP PNG file.
        Background no longer white, but greyish. I'm able to correct this, if I want, so it's not a heavy problem.

        I want to add, that decreasing colors is not a guarantee that noise will be gone.
        But this can be solved with the Clone tool of IVPaint.

        Another option could be to load a proper 16-color palette file.
        0.6180339887
        Rest In Peace, Sam!

        Comment


          #5
          I came here for this exact reason. I was hoping for a checkbox option that forces the auto-palette generation to make at least one colour pure white.

          My problem is that I do a lot of logo work, and love IrfanView for its PNGOUT support. It's often advantageous (for file size) though to reduce the colours to 16. It's often imperceptible, except that the otherwise white background changes colours.

          Comment


            #6
            I also have very frequent issues converting JPG to GIF . Mostly when image really only has only a few colors. Perhaps a few options on the decrease color depth selection like :
            (_) prefer pure white
            (_) prefer pure black

            Comment


              #7
              Nice idea. Support ++

              An elegant extra would be to have this color as first or last color in the palette.
              Last edited by Sam_Zen; 04.04.2008, 02:27 AM.
              0.6180339887
              Rest In Peace, Sam!

              Comment


                #8
                Yes, I came searching the forum with exactly this wish: an option on decrease color depth so the whitest color becomes pure white. I've played with batch conversion (decrease color depth + increase contrast + increase brightness), but this did not always achieve the goal or had undesired side effects.

                Comment


                  #9
                  As long as there are no direct tools for this, I think the simplest workaround is with the palette.
                  As soon as you have 256 colors or lower, there's a palette.
                  So the nearly white color is one of the palette colors.
                  Most of the time it's easy to recognize which one it is. And often it's the first or the last one.
                  So, via Image/Palette goto Edit Palette, double-click on the color and replace it by white.

                  Batch-processes become relevant with groups of images having the same kind of properties.
                  If these files, after color-decreasing, contain almost the same palette, it could be worth to save the edited palette.
                  This can be used in the command-line option "/import_pal=palfile".

                  Unfortunately, this option is not represented in the Batch-conversion ('B') dialog of IV.
                  0.6180339887
                  Rest In Peace, Sam!

                  Comment


                    #10
                    A good way to resolve the problem would be to add a B/W threshold value option in 2bpp color reduction; I asked to Irfan if he could implement it, but he said that it's difficult to change the algorithm to support such threshold.
                    BTW, another method that works quite well is to use IrfanPaint's floodfill tool with a medium-high tolerance value to make the background white before reducing the color depth.
                    IrfanPaint developer
                    The latest stable IrfanPaint version is the 0.4.13.70.
                    IrfanPaint is now open-source (released under BSD license).

                    Comment


                      #11
                      Originally posted by MItaly View Post
                      BTW, another method that works quite well is to use IrfanPaint's floodfill tool with a medium-high tolerance value to make the background white before reducing the color depth.
                      That seems to work a treat. F12 and a couple of clicks is all it takes.
                      Attached Files
                      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                      Comment


                        #12
                        Yep, thanks for reminding me, MItaly.
                        Since the tolerance of the floodfill of IP was introduced, I favoured that method as well.
                        0.6180339887
                        Rest In Peace, Sam!

                        Comment


                          #13
                          Originally posted by Sam_Zen View Post
                          As long as there are no direct tools for this, ... via Image/Palette goto Edit Palette, double-click on the color and replace it by white.
                          Thanks, that is exactly what I have been doing. However, most days I must deal with a couple of dozen such situations. I was hoping to find a simpler method. If the white areas such as backgrounds are not pure white, they print with undesirable faint shading. The color content of the many images varies a lot, so a fixed palette does not help.

                          Comment


                            #14
                            F12 and a couple of clicks is all it takes.
                            Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                            Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                            Comment


                              #15
                              Originally posted by RJM View Post
                              when one chooses to reduce color depth, e.g. of a scanned image, the program tends to make almost white fields less white.
                              It would be better, when the new intensity ladder (e.g. 16 colors - 4 BPP) always includes pure black and pure white when luminances in the displayed image exist that are (already) nearly white resp. black.

                              I think most users that intend to decrease color depth not only have the intention to save space, but also to remove noise or nearly white background on scanned documents, resp. get true black with text on documents.
                              Both have a great impact on printing quality.
                              Twelve years later, I come back on the same issue.

                              I also regularly rework pictures (actually scanned music scores).
                              I use contrast adjustment to get a well contrasted picture, with a clear white and a clear black and some intermediate grey tones and this works fine. However, when I decrease the number of colors to 4, there is no true white nor true black anymore; I get grey instead and I need to edit these two colors on the palette to make them again pure white and pure black. I have to repeat all this for each page of my scores !

                              Maybe this can be done using bach settings, but I did not find a way to prevent this "greying" to happen when the colors depth is decreased to 4 colors.

                              Thank you in advance for your help.

                              Comment

                              Working...
                              X