Announcement

Collapse
No announcement yet.

Compressing PNG Images

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

    Compressing PNG Images

    I never cease to be amazed at the different file sizes I get with compression. It seems that every file is unique and the best method depends on the data being compressed.

    Often I find that a dialogue box saved with FastStone Capture (which has an option to set the PNG compression level to 9 (like IrfanView) gives the best results. Opening it in IrfanView and resaving it can increase the file size.

    Original 31,290 bytes saved from FastStone Capture at level 9. (Attached)
    Saved from IV at level 9 = 45,157
    Original compressed with PNG crush in 3 seconds = 31,290 bytes
    Original compressed with PNGOUT in 3 minutes = 41,285 bytes (sic)
    IV saved file compressed with PNG crush = 31,253 bytes
    Attached Files
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    #2
    Simple screenshots are best compressible with no prefiltering. So, yes one should look at the picture if the goal is best compression. An 'intelligent' crusher could perhaps count the used colors.

    PNGOut, two passes = 32,912 bytes
    PNGOut, many passes = 32,235 bytes

    Comment


      #3
      I wonder why I get such poor resuts with PNGOUT. I tried resetting the defaults, but it is still giving significantly bigger files (44K), not smaller, than FastStone.
      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

      Comment


        #4
        IV saved file compressed with PNG crush = 31,253 bytes
        Only now I noticed this line. How is this possible? Is PngCrush lossy?

        To disable prediction filters, use command line parameter "/f0", or select "None" in the GUI version (IrfanView plugin).

        In the past I've made a request to make filters selectable without PNGOut. Coffee Cup HTML editor had them, I recall (but the option only worked in the save-for-web preview). This could be useful if absolutely best compression is not required.
        Last edited by j7n; 29.06.2008, 02:56 PM.

        Comment


          #5
          Bhikkhu,

          You may want to try:

          Download OptiPNG for free. Advanced PNG optimization program. OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information. This program also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections.


          optipng -o5 myfile.png

          or

          optipng -i1 -o7 -v -full -sim myfile.png -log myfile.log

          Comment


            #6
            Originally posted by j7n View Post
            Only now I noticed this line. How is this possible? Is PngCrush lossy?
            No. I tried with two files compressed by IrfanViiew using compression settings of 6 and 9 respectively without PNGOUT.

            Orignal saved from FastStone Capture
            Preferences Fonts.png = 31,290 bytes (using the Max setting = 9)

            Preferences Fonts 6.png = 46,469 bytes
            Preferences Fonts 9.png = 45,157 bytes

            PNGcrush gave the same result for both files

            Preferences Fonts 92.png = 31,253 bytes
            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


              #7
              Originally posted by dvipmail View Post
              Bhikkhu,

              You may want to try:

              http://sourceforge.net/projects/optipng/
              No thanks. Maybe you may like to try it on the attached file and post your results. We're getting off-topic, so I have split this thread to the Software Forum.
              Last edited by Bhikkhu Pesala; 29.06.2008, 05:30 PM.
              Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

              Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

              Comment


                #8
                I tried to capture a complex photorealistic image (my desktop) with FastStone, 30 days trial, Portable release.

                FastStone (default comp level): 1,473,431 bytes
                IrfanView (9): 1,322,886 bytes
                PNGOUT (no filter): 1,382,380 bytes
                PNGOUT (Paeth): 1,340,467 bytes

                Decompression speed in IV (probably need even bigger files to accurately compare):
                FastStone (default comp level): 63 milliseconds
                IrfanView (9): 94 milliseconds
                PNGOUT (no filter): 63 milliseconds
                PNGOUT (Paeth): 140 milliseconds

                This would indicate that FastStone is optimized for screenshots, and therefore use no prediction filters.

                Comment


                  #9
                  Try FastStone's Maximum compression level. The default is 6 as in IrfanView.

                  BTW A free version of FastStone is still available from OldVersions.com. See my sig.
                  FastStone Capture is an essential tool for me, so I have a licensed copy of the latest version.

                  I found the filter options in FastStone and tried the Paeth filter on a photograph. Without it compression was much less than IV, but with it it was slightly better.

                  FastStone Max No Filter = 4,750,841 bytes
                  IV at level 9 = 2,999,839 bytes
                  FastStone Max Paeth = 2,994,553 bytes
                  IV at level 9 + Crush = 2,990,699 bytes

                  All this goes to prove that you need to know a lot about the image data being comrpessed before deciding which method to use. Much too complex for the average user to consider all these variables.
                  Last edited by Bhikkhu Pesala; 29.06.2008, 08:56 PM.
                  Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                  Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                  Comment


                    #10
                    I don't see where to specify compression strength. "Preferences Fonts" sample comes out 31,272 bytes – smaller than PNGOUT's über deflate could produce. IrfanView really needs the filter option to catch up.

                    PNGOUT takes too much time for the average user.

                    It should be noted that "No filter" can in some cases compress more and less intensive filters (none < sub < paeth) take less resources during decompression. If an application requires thumbnails to be generated often, or the images are large this might become significant.
                    Last edited by j7n; 29.06.2008, 09:09 PM.

                    Comment


                      #11
                      Originally posted by j7n View Post
                      I don't see where to specify compression strength.
                      There is an options button on the Save dialogue. On the options dialogue you can choose the filter and the compression strength.

                      Yes. No filter seems best for dialogue boxes — which I suppose is why its the default setting. I think PNGOUT is just a waste of time. Other methods seem much faster, and often better too.
                      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                      Comment


                        #12
                        I agree, a waste of time. I tried PNGOUT a couple of occasions, but it didn't bring extra value imo.
                        And the shareware plugin has a filesize limitation. So I stopped using it.
                        0.6180339887
                        Rest In Peace, Sam!

                        Comment


                          #13
                          The "button" wasn't visible on my computer. It turned out I had click on the format description text. There are a lot of options, looks like they took the same graphics library as was used in Coffee Cup. I've not seen RGB-JPEG anywhere else.

                          One important setting is missing though, you can't turn off color subsampling. On the "Preferences Fonts" sample the deffect is easily "abx"-able when you look at the red 'close' button and most of the Clear-Typed text.

                          What is this size limit you've been mentioning? I did notice that Ken Silverman is selling a version for money, but the IV pluging does not say shareware anywhere. PNGOUT is irreplaceable in one specific case. It is one of the rare programs that can process transparency. IrfanView cannot.

                          Comment


                            #14
                            It's a long time ago, but it was something like 65 KB.
                            0.6180339887
                            Rest In Peace, Sam!

                            Comment

                            Working...
                            X