Announcement

Collapse
No announcement yet.

Change color depth to RGB565 in Batch Conversion Mode

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

    Supported Change color depth to RGB565 in Batch Conversion Mode

    I'm using Image->Decrease color depth->65526 Colors (24 BPP, simple RGB-565) very often with scanned images/documents, which are saved as PNG afterwards.

    Unfortunately I have to change color depth manually with every single file, since IrfanView's batch mode doesn't offer this option under "Use advanced options".

    Thus, it would be very useful if this option could be added asap.

    If somebody knows a tool, which allows batch conversion to RGB565, please let me know!

    I'd like to use it in the meantime.

    #2
    You could do this in Photoshop CS2 (freely available) or Paint Shop Pro 9 by recording an Action or Script respectively. Photoshop can save 16-bit BMP files, which can be converted to another format later if desired. Photoshop doesn't support dithering in this process, although you could add noise beforehand, less to the green channel, within the same Action. PSP does implement dithering.

    The BMP files saved by Photoshop are true 16-bit, and will exhibit loss of brightness if opened with IrfanView. PS will redistribute the levels from true black to white upon opening and the contrast/brightness will stay roughly the same, but the color will no longer be precisely quantized to 565.

    What application requires you to use 16-bit color? This was mainly used with older video games in the 1990s to save video memory. You get nasty color banding on scanned documents where large areas are close to white. PNG gives maximum compression on true 16-bit color with prediction (sub/paeth) switched off, because after prediction the color depth expands. Irfan doesn't support configuring PNG prediction.

    Comment


      #3
      Hi j7n!

      Thanks for your tips!

      ...but nevertheless converting to RGB-565 (with 24 bpp) using Irfanview seems to remain the best solution for my needs.

      As I wrote, I'm doing this with scanned images like CD covers, brochures, drawing or similar images, which don't have the brightness/color depth that photos have.

      This saves about 25% space on every png file without a visible loss of quality. Most of these scanned images do not have more than 20k to 30k colors before converting and they loose usually less than 10% of these colors when they are converted (if Irfanview counts the colors right).

      Since images of brochures, CDs ... are usually printed with much less that 20k colors, reducing the color depth to RGB-565 could even bring these images near to the original. Thus, converting to RGB-565 with 24 bpp is not a big problem, while converting to 256 colors or 16 bit changes the images dramatically. Especially if you add noise furthermore.

      Comment


        #4
        Originally posted by 0maboy View Post
        If somebody knows a tool, which allows batch conversion to RGB565, please let me know!
        Another option is ImageMagick. This is a hard to use command-line tool. However, it can be set up to do simple, repetitive tasks in batch. The command allows to dial in variable amount of quantization per channel, optionally with ordered dither. This noise shaper could be the best balance between image quality and file size. It doesn't add noise where the color matches exactly, as in pure white. Using the same quantization for all channels (555) would reduce appearance of false color.

        Here is a comparison of the software tools I have at hand. 565 have been upconverted to 888 with Photoshop, since PNG doesn't support 16-bit depth natively.

        Of course, the file size increases with dithering. If the scanned paper has been clipped to pure white, then dithering might not be beneficial. Another case is when there are shadows present where the paper didn't touch the scanner platten firmly.

        24-bit


        1.3% gaussian dither on layer


        1.5% gaussian dither on overlay


        Photoshop, direct, no dither


        IrfanView, dither checkbox has no effect


        Paint Shop Pro 9, error diffusion noise shaping


        Image Magick 6, -ordered-dither threshold,32,64,32


        Image Magick 6, -ordered-dither o8x8,32,64,32


        The total size of the "16-bit" files as saved by IrfanView is 230 kB, and 184 kb when saved by FastStone Image Viewer without prediction.

        Comment


          #5
          Thanks for your comparison of different conversion results of different programs and options!

          Very interesting!

          Especially because it seems to reveal a bug in Irfanview's RGB565 conversion!

          If I take your 24 bit file and convert it to RGB565 I'm getting the same result you did ("IrfanView, dither checkbox has no effect").

          While it is no wonder that the dither checkbox has no effect (because its indicated, that its meant only for conversions to 256 colors), it is very strange that the resulting image has only 128 colors, whereas a conversion to 256 colors produces a file with 255 colors that looks even better.

          This shouldn't happen, right? So, in my opinion this is a bug!

          And that's why I'll think again a little bit 'bout my way saving files even though my results have always be "flawless" before.

          Maybe I'll take a look a ImageMagick and Faststone.
          Last edited by 0maboy; 13.06.2017, 10:09 PM.

          Comment


            #6
            It is not a bug. But the user interface does not indicate that dithering isn't supported (by disabling the check box), other than perhaps by saying that the conversion is "simple", which could mean many things. But it seems that you do not want dithering if your main goal is to reduce the file size, which results from large areas of the same color.

            The reason why those images contain so few colors is because the quantization is uniform across all colors and brightness levels. Every 8 or 4 levels in the input get collapsed into one. The files do not carry a palette like 8-bit ones do. A palette would consume 192 kB of memory on its own.

            This test image was essentially a single diagonal band of 362 steps (plus noise). A bigger image with more variation would result in more colors. A true black and white scan would give only 64 colors (some of them tinted purple or green).

            Image Magick gives me the choice between no dithering and ordered. No dithering was achieved with the use of the "threshold" variable, which didn't make sense and maybe has been changed in the current versions. I used the "convert.exe" module.

            convert.exe 24.bmp -ordered-dither o8x8,32,64,32 16_magic_8x8.bmp
            Last edited by j7n; 14.06.2017, 04:20 PM.

            Comment


              #7
              Batch decrease color depth to 65536 Colors

              Alright, so I can do the following:

              1) Open a .png image.
              2) Click Image> decrease color depth and choose the 65536 Colors.
              3) Press S to save as.

              This process produces an Image that saves about 30% from 16.7 Million colors.
              From what I understand, there is currently no way to have IrfanView batch perform this process.
              So I am requesting that a batch decrease color depth option be added (perhaps in the "CHANGE COLOR DEPTH:" menu under "Advanced" for Batch conversion settings).

              Comment


                #8
                If anyone has sent the feature request to Irfan Skiljan (Help, About IrfanView for his email), please let me know his response and I will update the thread.
                Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                Comment

                Working...
                X