Menu

#76 TruePNG seems to butcher 2-bit grayscale PNGs

16.x
open
Nikkho
2022-07-17
2020-07-26
TPS
No

@nikkho I tweaked https://media.defense.gov/2020/Jul/22/2002461866/-1/-1/0/200722-F-GO452-0002.PNG into a 2-bit (4 color) grayscale PNG (attached) & ran through FO on best lossless (though I unchecked "Copy Metadata") settings. TruePNG is destroying the image by adding a weird interlacing-type pattern. (I'm reporting this ticket to its dev @ x128@ua.fm, but, since this hasn't been updated for years, I'm not holding my breath.) I'm not sure what's causing TruePNG to fail – maybe the rarity of a 2-bit grayscale PNG, so it's not been tested on that so much? Anyway, is it possble to quarantine TruePNG for such images until resolved?

From the reading the FO's source from https://sourceforge.net/p/nikkhokkho/code/HEAD/tree/trunk/FileOptimizer/Source/cppMain.cpp#l1886, it seems the TruePNG options being compiled are -o4 -tz -md remove all -a1 -g1 which should be equivalent (per command-line help) to -zc9 -zm1-9 -zs0,1,3 -fe -a1 -i0 -md remove all -tz -md remove all -a1 -g1 which seems safe enough (though -md remove all -tz -md remove all seems doubly redundant – remove all chunks, then compress the deleted text chunks & then remove them again⁈).

If run multiple times until no more size savings. the image eventually degrades to an all-black 1-bit b&w image of the correct dimensions.

N.B.: This seems conceptually similar to #69, but I can't confirm that bug @ all now (can't reproduce it now from the original file there) & Pingo seems to have nothing whatsoever to do with this.

1 Attachments

Discussion

  • necros

    necros - 2020-07-27

    See no interlace pattern, pls point me

     

    Last edit: necros 2020-07-27
    • TPS

      TPS - 2020-07-30

      @necros2014 (It took me a while to understand what you meant.) Input that PNG as a source file & then repeat running FO (per settings above) on results (pressing shift-F5 in-between runs to make sure the updated file is used), it'll quickly become obvious.

       
  • necros

    necros - 2020-07-31

    Still the same 26105 colors after 3 runs in lossless Fast mode

     

    Last edit: necros 2020-07-31
    • TPS

      TPS - 2020-08-02

      @necros2014 I'm sure I've no idea where you got 26105 colors. Each file above is 4-color grayscale - black, white, & 2 grays! Also, of course, you'd hafta replicate FO's options above.

       
      • TPS

        TPS - 2020-08-03

        @necros2014 Ahh, the original NASA file linked above has 26105 colors, but that's irrelevant for this issue — the 2 attachments above are what I'm testing this with.

         
  • Nikkho

    Nikkho - 2022-07-17
    • assigned_to: Nikkho
    • Milestone: 14.x --> 16.x
     

Log in to post a comment.