Announcement

Collapse
No announcement yet.

Color Depth: Don't modify colors if color count is low enough already

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

    Requested Color Depth: Don't modify colors if color count is low enough already

    Sometimes I have 24 BPP images that I want to reduce to 8 or 4 BPP (Image -> Decrease Color Depth). The image's color count may be low enough already for the desired color depth (i.e. <=256 colors for 8 BPP or <=16 colors for 4 BPP; as reported by Image -> Information -> Number of unique colors). In this case the colors could be maintained exactly in the reduced BPP version as they were in the 24 BPP version if the image. Currently this is not the case and the are unnecessarily modified during color depth reduction.

    A typical scenario: I used a quantizer plugin (e.g. the Ximagic Quantizer) to reduce an image's color count because the plugin has additional options that the internal "Decrease Color Depth" dialog does not provide. The image now has 16 unique colors only but is still a 24 BPP image. I want to save the image as 4 BPP without any additional (unnecessary) color changes.

    P.S.: Thanks for creating and maintaining for many(!) years IrfanView -- one of my few essential wouldn't-know-what-to-do-without tools.

    #2
    You can use the PNGOUT plugin to save PNG images with the desired colour depth.
    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


      #3
      Originally posted by Bhikkhu Pesala View Post
      You can use the PNGOUT plugin to save PNG images with the desired colour depth.
      Yes, I already found that workaround while researching my problem. But I expect the requested change should not be too difficult to implement and would IMHO be the most logical behavior for images with low color count.
      Therefore the current state is not buggy, just inconvenient. Still, I would be very happy if this could be implemented.

      Comment


        #4
        We have discussed this subject a number of times already. There are a lot of different filters available to reduce color depth. If there was one that was best in all circumstances then the others would not exist. The filter that Irfan, the author of this program, has chosen is fast and does a reasonable job of reducing color depth of typical photographic images containing thousands of colors but it is not good at preserving the colors when there are only a few present, as you and others before you have discovered.
        I myself think that the Xiaolin Wu filter would be a better compromise but presumably Irfan does not. I do not think it a question of being difficult to implement, just difficult to choose one that satisfies everybody.

        Comment


          #5
          Originally posted by Mij View Post
          I do not think it a question of being difficult to implement, just difficult to choose one that satisfies everybody.
          I can agree to that only partially.
          When I want to reduce an image's color depth to 4 BPP, i.e. a palette of 16 colors, and there are 1E6 or 999 or even just 17 unique colors in the image then I fully agree that different users have different needs and may prefer different algorithms. But when there are 16 or less unique colors in the image then there is no need for an algorithm choosing some best solution because it is possible to put all 16 (or less) colors into the palette exactly as the are and the image will not be just close to what it was before but will stay exactly as it was before the reduction. As a matter of fact this is not really a color depth or color count reduction but a BPP reduction with no change whatsoever to the existing colors.

          Comment


            #6
            I did say "...that satisfies everybody", not "...that satisfies you". The problem that many users have is that they want to edit a paletted PNG or GIF image with one of the Irfanview features, such as Resample or Sharpen, that automatically converts to 24 bit and introduces many additional colours to give better anti-aliasing of edges. Then when they reduce color depth back to what it was originally they find that the colors have changed. Some want the colors with highest populations preserved, others want primary colors or black and white kept and some have the most bizarre ideas of what they think Irfanview should do to meet their particular requirement. Yours sounds quite simple and I would have thought that the Riot plug-in would have met your needs. Did you try that? Select "save for web" from the File menu. You do not have to reduce the file size if you are asked whether you want to, but if you do refuse avoid the Neuquant filter for any processing or you could be waiting a long time for it to finish.

            Comment

            Working...
            X